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)
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.
0
Still error
Please write the code instead
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)