+ 1
Please help me!!
how can i discovered this problem with python??? When you go out to eat, you always tip 20% of the bill amount. But who’s got the time to calculate the right tip amount every time? Not you that’s for sure! You’re making a program to calculate tips and save some time. Your program needs to take the bill amount as input and output the tip as a float. Sample Input 50 Sample Output 10.0
4 Respuestas
+ 6
Yes its basic maths if you know math then you would be knowing that we get 20% simply multiplying 20/100 to the given number
So do same thing here and find the value and assign it to another variable and print it
+ 3
Just like the guy above me said. Use simple math, take this advantage of Python, in which simple math can be interpreted in a single line.
A sample:
total_value = 50
tip = (20 * total_value) / 100
print(tip)
Try it out there, it'll give you an idea. Now just build your own solution!
0
total_value=50
Print(total_value*0.2)