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 Name= int(input()) That’s the program any idea how to solve?
5/11/2021 1:07:48 PM
Sara_88910 Answers
New AnswerSara_889 I can't understand your code Answer is zero correct due to you use modulus Operator That's use as 9%5 will give 4 12%2 will give 0
Sara_889 your welcome Keep learning 👌😍 If any problem occurred during learning or coding just message me, I'll help as possible..
Explanation: 20% of 50 is 10. To calculate 20% of a given amount, you can multiply the number by 20 and divide it by 100: 50*20/100 = 10.0 This is the question?
bill = int(input()) #your code goes here x= 100 x *= 100 x %=10 print(x) Still my output zero
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message