+ 1

Help me with stage 20 in python learning.

I'm stuck in stage 20 and cant solve the question (tip calculator), I didn't get it. that's mean I am not smart at all?!😕

4th May 2022, 3:16 PM
ali abdolapor
10 Respostas
+ 5
Share your tried code link here with saving .. Along with full question..
4th May 2022, 3:34 PM
Jayakrishna 🇼🇳
+ 3
your program should work on various inputs.. Take input into bill bill = float( input() )
4th May 2022, 4:48 PM
Jayakrishna 🇼🇳
+ 1
hello again. thats the question. 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 what the question wants? I can't get that. I write code like this: bill=50 print(20*float(bill)/100) but the answer section is tripartite, and it says try again. my english is terrible, so forgive me for my mistakes.
4th May 2022, 4:41 PM
ali abdolapor
+ 1
thank you friend. god bless you.
4th May 2022, 6:10 PM
ali abdolapor
+ 1
First you need to get the bill as input from the user: bill = float(input()) Then you can calculate the tip based on the bill: tip = bill*20/100 And that's it! Now you only have to output it: print(tip) The problem with your code was, that you didn't take a flexible bill (input()), but rather always set bill to be 50 The way you calculated the tip in the print statement is correct tho (I think) Hope I could help!
6th May 2022, 5:08 AM
LoonyLynx
0
You're welcome..
4th May 2022, 7:27 PM
Jayakrishna 🇼🇳
0
Share your code link buddy
5th May 2022, 4:27 PM
Muhammad Rehan
Muhammad Rehan - avatar
0
hello. thank you for answering. actually I am new in this app. just three or four days. how to share my code link?
5th May 2022, 6:01 PM
ali abdolapor
0
thanks a lot pal. yeah, you right. I think that's why the answer is tripartite. thanks again. best wishes.👍
6th May 2022, 3:53 PM
ali abdolapor
0
You're welcome!
6th May 2022, 4:01 PM
LoonyLynx