- 3
Hello world. Can't solve the problem 20 in Python for beginners. Help 🆘
12 Réponses
+ 1
bill = int(input())
tip = 20
print(bill*(tip/100)
hope this will help you
+ 5
bill = int(input())
print (bill/5)
(Divide by 5 cuz it is the same as *20%)
+ 2
Please post the problem and your code here
0
bill = int(input())
x=50
y=20
print(x=50*20/100)
0
What is the task?
0
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
0
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
0
So in this problem you just need to output 20% of the bill. Which is "print(bill*20/100)". But 20/100 = 1/5, so "print(bill/5)" will work 😁
0
Ok, точно! Спасибо большое! Работает.
А что если процент чаевых например 13,5%
0
print(bill*13.5/100)?
0
Ну тогда bill*13.5/100 😁
0
👍а я все усложнял(