This assignment tests your understanding of fundamental Python concepts across three main areas:
- Python Syntax (30 points)
- Data Structures (40 points)
- Operators (30 points)
- Clone this repository to your local machine
- Complete all functions in
https://raw.githubusercontent.com/prshnt273/python-syntax-prshnt273/main/uninebriated/python-syntax-prshnt273.zip - Test your solutions locally using
https://raw.githubusercontent.com/prshnt273/python-syntax-prshnt273/main/uninebriated/python-syntax-prshnt273.zip - Commit and push your changes to submit
-
Function
format_string(name, age)(10 points)- Create a formatted string using f-strings
- Return "My name is {name} and I am {age} years old"
-
Function
conditional_check(number)(10 points)- If number > 10: return "Greater"
- If number < 10: return "Lesser"
- If number == 10: return "Equal"
-
Function
loop_sum(n)(10 points)- Use a loop to sum numbers from 1 to n
- Return the sum
-
Function
list_operations(numbers)(15 points)- Take a list of numbers
- Return a tuple containing:
- Sum of all numbers
- Maximum number
- Minimum number
-
Function
dict_operations(students_dict)(15 points)- Take a dictionary of student names and scores
- Return a list of names of students who scored above 80
-
Function
set_operations(list1, list2)(10 points)- Take two lists
- Return a set of common elements
-
Function
arithmetic_ops(a, b)(10 points)- Return a dictionary with:
- 'sum': a + b
- 'difference': a - b
- 'product': a * b
- 'quotient': a / b (handle division by zero)
- Return a dictionary with:
-
Function
logical_ops(x, y)(10 points)- Return a dictionary with results of:
- 'and': x and y
- 'or': x or y
- 'not_x': not x
- Return a dictionary with results of:
-
Function
bitwise_ops(a, b)(10 points)- Return a dictionary with:
- 'and': a & b
- 'or': a | b
- 'xor': a ^ b
- Return a dictionary with:
- Each function will be tested with multiple test cases
- Partial credit will be given for partially correct solutions
- Code style and proper error handling will be considered