0
Went in resturant give tip 20% .Your program take bill amount as input & output tip as float. Sample Input ( 50)& output (10.0
Went in resturant give tip 20% .Your program needs to take the bill amount as input and output the tip as a float. Sample Input 50 Sample Output 10.0 This program is from python beginner code 2 or code 3 plz help
8 odpowiedzi
+ 4
Please post your attempt to help us help you
+ 4
You need to write a code that will work for any input not one code for each test case.
All you need to declare bill as input variable and multiply it with 20% means 20/100
+ 2
Sandeepkumar Arisella
I am sure that PRIYANSHU GOYAL appreciates you supplying the answer, now he doesn't need to think for himself at all.
Which means he will probably not learn anything either.
Perhaps, if you attached a description of how your code works, he may take the time to read it & possibly learn something.
+ 2
Sandeepkumar Arisella
Good intentions
I have also done the same but now I try to attach an explanation with it.
You have a good heart
+ 2
# You can use this :(if input always an integer
# Use try/except block to handle any errors
print(0.2*int(input()))
+ 1
# Check this code for your problem
bill = int(input())
#your code goes here
tip = float(bill*0.20)
print (tip)
+ 1
Hello Rik Wittkopp thanks for reminding me,but I thought he might learn from code, that is why I posted the code
0
I write a lot