0
Has anyone made lesson 18 code project(tip calculator) of PYTHON FOR BEGGINERS.
Please help me regarding this I tried many times but failed in it
8 ответов
+ 2
Tip calculator is very easy problem, see what you have to do:
Take a input (a number), now simply print the 20% of that, for example: if I input 100 you have to print the 20% of 100 that is 20.
And yes, you will not get any help from the community till you show us your attempt (attach the code to this question or copy paste it here).
0
THERE ARE THREE TEST CASES. I CAN'T SOLVE ALL OF THOSE AT A TIME.
I USE THIS CODE
bill = int(input())
print(float(125/5))
print(float(268/5))
0
You have to make such a code that will be accepted for all values not for just these.
For example: we have to add 8 and 5, we can do:
...
print (8+5)
...
but more effective way to add two numbers is:
x=int(input())
y=int(input())
print (x+y)
Now if you want to input a 'integer' then you can do:
...=int(input())
And for float:
...=float(input())
And for calculating percentage of a number you can see the given example:
50% of 60:
(50/100)*60=30
now use your Logic how you will do this in Python (change 50 to 20).
INDEPENDENT
0
I HAD TRIED SO MANY TIMES. CAN YOU SEND ME THE CODE. PLEASE
0
print(0.2*int(input()))
#(It's one-liner code but the logic is same)
0
THIS CODE IS ALSO NOT WORKING BROO. WAIT 0.2*int IS THIS POSSIBLE ???
THIS QUESTION MADE ME FREAK OUT YRR. HOW I ANSWER IT 🥺🥺🥺🥺
0
Its working fine🙄
Ya its possible to do that.
Okay then, if that is not working you can split this code:
bill=int(input())
print ((20/100)*bill)
0
THANKS BROOO IT WORKED I HAVE BEEN VERY TENSED ABOUT IT THANK YOU VERY MUCH BROOO.