PASS Midterm Review
PASS Midterm Review
Midterm Review
2. Create a program that takes a string input from the user and and checks if the length
of the string is divisible by 4. If true the program outputs “The string is divisible by
4!”, otherwise print the string is not divisible by 4.
i = 0
______ i < 10:
print(i)
i += 1
_____ i in _______(10):
print(i)
Week 6: Functions
5. List 3 advantages of using functions
a.
b.
c.
6. Write two python functions to find the sum or difference of a list of numbers the user
inputs. The user can input as many numbers as they want. They will choose whether
they want to find the sum or difference. If they choose difference the equation will be
num1 - num2 - num3 - .....