Skip to content

SthembisoMfusi/Assessment2-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assessment 2 - Python

Purpose

This assessment is designed to help you practice and solidify your understanding of fundamental Python concepts. You will be required to complete a series of functions in the assessment.py file. Your solutions will then be tested using the provided test_assessment.py unittest file.

Learning Outcomes Assessed

This assessment focuses on the following Python skills:

  • Defining and using Functions (parameters, return values).
  • Implementing Basic loops (for, while).
  • Processing data (manipulating lists, strings).
  • Implementing Basic error handling (try-except).
  • Developing Simple algorithms for problem-solving.

Files

  • assessment.py: This is the file you need to edit. It contains function stubs that you must complete according to their docstrings.
  • test_assessment.py: This file contains unit tests to check if your functions in assessment.py work correctly. Do not modify this file.
  • README.md: This file, providing instructions.

Instructions

  1. fork the repository to your own GitHub account.

  2. Understand the Tasks: Open assessment.py. Read the docstring for each function carefully. The docstring explains what the function should do, its parameters, and what it should return.

  3. Implement the Functions: Write the Python code within each function definition in assessment.py to meet the requirements described in its docstring.

  4. Run the Tests: Once you have implemented some or all of the functions, you can test your work. Open your terminal or command prompt, navigate to the directory where you saved these files, and run the following command:

    python -m unittest test_assessment.py

    Alternatively, if your IDE has a "Run Tests" feature, you might be able to use that.

  5. Interpret the Results:

    • OK: If all tests pass, you'll see a message like OK.
    • FAILURES/ERRORS: If some tests fail, unittest will provide details about which tests failed and why. Use this feedback to debug your functions in assessment.py. The test output will show the expected output vs. your function's actual output.
  6. Iterate: Modify your code in assessment.py based on the test feedback and re-run the tests until all tests pass.

Good luck!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages