This repository is a demo for our coding assignments. Please note that nothing in this repository is related to database!
Write a function called avg_list
in exercise.py that returns the average of a list of number in python. The return should be rounded to int.
def avg_list(numbers: list) -> int:
"""
Arguments:
numbers (list): a list of numbers
Returns:
int: the average of the list, rounded
"""
#write your implementation here
pass
numbers = []
numbers.append(3)
numbers.append(2)
numbers.append(6)
numbers.append(-1)
print(avg_list(numbers)) // should be 3
numbers.append(5)
numbers.append(1)
print(avg_list(numbers)) //should be 3
- When the assignment is released, we will provide you with a link. Click link and accept the homework. This will create a repo in you GitHub.
- Clone this repository to your computer. (
git clone <repo url>
) - Work on your codes.
- When you think you're ready, push your changes to GitHub (
git push origin master
) - GitHub Action will run the testcase, and you can check if you passed.
- As mentioned in tutorial, make constant, semantic commits locally.
- We will replace the testcase for grading, so please don't do testcase-oriented programmng. 😊
- You can push to your repository to perform test run as many times as you like before deadline.