+ 1

What's wrong with my program?

Fruit = input() Day = input() Kilo = float(input()) If fruit == 'banana' and day == 'Monday' or 'Tuesday' or 'Wednesday' or 'Thursday' or 'Friday': Print(kilo*2.50) Elif fruit == 'banana' and day == 'Saturday' or 'Sunday': Print(kilo*2.70) Else: Print(error)

30th Mar 2020, 11:23 AM
PUFFIN Channel
PUFFIN Channel - avatar
6 Answers
+ 6
Fruit = input() Day = input() Kilo = float(input()) if Fruit == 'banana' and Day in ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday']: print(Kilo*2.50) elif Fruit == 'banana' and Day in ['Saturday', 'Sunday']: print(Kilo*2.70) else: print("Error")
30th Mar 2020, 11:53 AM
andriy kan
andriy kan - avatar
+ 1
BEN_10 I apologize for my illiterate presentation of my code. But if you do not look at the margins and uppercase and lowercase letters, and look for an error in the program, I can not understand why the program gives me only the first print, despite the input
30th Mar 2020, 11:37 AM
PUFFIN Channel
PUFFIN Channel - avatar
+ 1
BEN_10 , andriy kan , thank you for your help!
30th Mar 2020, 11:59 AM
PUFFIN Channel
PUFFIN Channel - avatar
0
BEN_10 input banana Sunday 4, outputs 10, not 10.8
30th Mar 2020, 11:50 AM
PUFFIN Channel
PUFFIN Channel - avatar