question archive Fill in the blanks with the needed values to make this code work def function (values): for _ in _ : # check if a value is even, you check if val % 2 == 0 # You will likely need to fill in the blank #: You may also need to change == to !=, depending on your implementation if _ % 2 == 0: # check if a value is divisible by 5, you can check val % 5 == 0 or if the # number ends in a 5 or a 0
Subject:Computer SciencePrice:9.82 Bought3
Fill in the blanks with the needed values to make this code work
def function (values):
for _ in _ :
# check if a value is even, you check if val % 2 == 0
# You will likely need to fill in the blank
#: You may also need to change == to !=, depending on your implementation
if _ % 2 == 0:
# check if a value is divisible by 5, you can check val % 5 == 0 or if the
# number ends in a 5 or a 0. You will likely need to fill in the blank
#Hint: You may also need to change == to !=, depending on your implementation
else if _ % 5 == 0:
#: You may also need to change to return False, depending on your implementation
return True
def main():
#pass this list into the function and print
check1 = [2, 0, 14, 8, 5, 15] # True
#TODO: You will need to pass this list into the function and print
check2 = [8, 30, 9, 10, 4, 5, 2, 12] # False
def function (values):
c=0
for i in values :
# check if a value is even, you check if val % 2 == 0
# You will likely need to fill in the blank
#: You may also need to change == to !=, depending on your implementation
if i % 2 == 0:
c+=1
# check if a value is divisible by 5, you can check val % 5 == 0 or if the
# number ends in a 5 or a 0. You will likely need to fill in the blank
#Hint: You may also need to change == to !=, depending on your implementation
elif i % 5 == 0:
c+=1
#: You may also need to change to return False, depending on your implementation
if len(values)==c:
return True
return False
def main():
#pass this list into the function and print
check1 = [2, 0, 14, 8, 5, 15] # True
print(function(check1))
#TODO: You will need to pass this list into the function and print
check2 = [8, 30, 9, 10, 4, 5, 2, 12] # False
print(function(check2))
main()
Step-by-step explanation
Output:
True
False