I'm working on a for loop that has a range of 1 which is a list. I'm trying to insert a conditional statement into my for loop that uses the modulo operator. I'm receiving a Type Error unsupported operand type(s) for %: 'list' and 'int
I've tried to remove the % sign and setting it to zero. I tried to remove the condition and set it to a variable. I also tried setting the modulo into a list by using the brackets and placing my integer 3 in it but receive another Type Error unsupported operand type(s) for %: 'list' and 'list
for i in range (1):
a=money = money %3 == 0
b=money = money %3 == 1
if a and b:
print( money[i]*6.00, money[i]*7.00)
elif a:
print (money[i]*6.00)
else:
print (money[i]*7)
My desire out put is to determine if my list is divisible by 3 or not so I can multiple the list by the price 6.00
Aucun commentaire:
Enregistrer un commentaire