- 1
Need help tip calculator python
Need to make tip calculator 50*20/100 This is what I got so far below meal =50 tip = 0.20/100 int(input ) print tip Thanks for any feedback
3 Respostas
+ 4
You can approach the task like this:
1. Get input() and store it into a bill variable
2. Convert bill to a numeric data type
3. Calculate the tip as 20% of the bill
4. print() the tip
+ 1
Rafael
1st mistake:
tip= 0.20/100??
Write it like:
20/100
OR
Simply 0.20 (or 0.2)
2nd mistake:
Why meal=50??
You have to make such a code which will accept all values,
Do you know how to take input from a user?
If not, use:
meal=int(input())
3rd mistake:
You did just printed the tip (which is actually 0.20 (but you wrote 0.20/100)
You have to multiply it to the meal
Like this:
0.20*meal
OR
(20/100)*meal
Now you have to print this total like this:
print(tip)
+ 1
Thanks