0

Someone explain me the answer of (Tip Calculator)

I did this and it shows error bill =int(input(50)) print (float (input) *20/100)

18th Feb 2022, 5:11 PM
Shehjad Noor
3 Answers
+ 2
Try bill = float(input()) Bill can be a floating point number and input parantheses should be empty. Then, in the next line instead of asking for another user input, use the variable bill in the expression. Also, you might have misunderstood input, it is a function so it has to be called as input() not as input. But, in any case it should not be used in the second line.
18th Feb 2022, 5:22 PM
Deepak Singh
Deepak Singh - avatar
0
Still error Please write the code instead
19th Feb 2022, 3:10 PM
Shehjad Noor
0
In code: bill=float(input()) print(float(bill*0.2)) As function: def getTip(): bill=float(input()) return float(bill*0.2) a=getTip() print(a)
20th Feb 2022, 12:15 AM
Deepak Singh
Deepak Singh - avatar