- Create a repository on your GitHub account.
- Use Python to wire down the solution.
- Push the solution to the above repository once done.
- Submit the repository link for grading.
- Ensure your repository has a well written README.
This project was created and is sole property of Annglorious mueni.
- This assessment is designed to evaluate your understanding of fundamental Python concepts.
- You are required to complete the tasks outlined below within the specified time frame.
- Ensure your code adheres to Python syntax and best practices.
- Write comments to explain your code where necessary.
- Create a well-written README file providing instructions on repository setup and running the application in the terminal.
- Create a new PRIVATE repository, and push your solutions to it.
- Basic data structures
- Functions
- Decorators
- Sequences
- Sets, Dictionaries
- Object-Oriented Programming
-
Function: add_numbers (2 points) Write a Python function named add_numbers that takes two parameters num1 and num2, and returns the sum of the two numbers.
-
Function: is_even (2 points) Write a Python function named is_even that takes a single parameter number and returns True if the number is even, and False otherwise.
-
Function: reverse_string (2 points) Write a Python function named reverse_string that takes a string text as input and returns the reversed version of that string.
-
Function: count_vowels (2 points) Write a Python function named count_vowels that takes a string text as input and returns the count of vowels (a, e, i, o, u) in the string. Ignore case sensitivity.
-
Function: calculate_factorial (2 points) Write a Python function named calculate_factorial that takes a non-negative integer n as input and returns the factorial of that number. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n.
-
Function: apply_decorator (1 point) Write a Python function named apply_decorator that takes a function func as input and applies a decorator named decorator_func. The decorator should simply print "Decorator Applied" before calling the original function.
-
Sequences: Sort List of Tuples (1 point) Given a list of tuples where each tuple contains a name and an age, write a Python function named sort_by_age that sorts the list of tuples by age in ascending order.
-
Sets and Dictionaries: Merge Dictionaries (1 point) Write a Python function named merge_dicts that takes two dictionaries as input and merges them into a single dictionary. If there are any common keys, their values should be summed up.
-
Object-Oriented Programming: Class Creation (2 points) Define a Python class named Car with the following attributes: make, model, year. Implement a method named display_info that prints out the car's information.
- One would need either linux or wsl for window users
- A copy of visual basic code installed
- A github account
- Open your terminal and go to the directory you wish to work from.
- Go to the following url using ur github account https://github.com/ANNGLORIOUS/phase3-code-1
- Go to the code tab and clone the ssh key
- Go back to the termina and type git clone <-followed by the ssh key you copied /cloned ->
- Enter your new cloned repository and type in code .
- On the visual studio code that has now opened, go to the the run tab and hit start debugging.
This program is built purely with python using the visual code environment.
For any issues please email me at annglorious.mueni@student.moringaschool.com
Apache License 2.0