- 3
Calculate tip 20%, the bill=50, could you help me to wright the code
bill=int(input()) ?
10 Answers
+ 8
#use this it will work
bill = float(input())
print(bill * 20/100)
+ 9
Tamara Danielyan hey I checked the question you have to read the question properly
This was an example:-
bill = 50 output=10.0
You have to actually make your code run all the test you are telling 25.0 because bill value entered was 125 đ€Šđ»ââïž
+ 8
If you are assuming input of bill value 50 and upon that 20%
You should use the formula:-
bill = float(input())
print(bill * 20/100)
this is general for all the input cases
but if you specifically want
Bill value to be 50
then predefined bill = 50 then print the formula
+ 8
Tamara Danielyan Happy to helpâș
+ 6
Tamara Danielyan According to the question posted you have said 20% and bill=50
So it's 20/100 * 50
Your question says that 20% from value=50
And the output will be 10
So can you tell how you want 25.0 ?
Share your question number and also the course where you are getting an error
+ 1
Bill =int(input ())
X = 20
Y = 100
Tip = Bill *int(x) / int(y)
Print float(tip)
0
In this case i received output 10, should be 25.0
0
I receiv response that my output 10, should be 25.0
0
The course is Pyton for beginners, topic 18
0
Thank you much for helping me