0

I don’t know what the code is for this

https://code.sololearn.com/cV4T6r7k66Hz/?ref=app

24th Jun 2022, 10:36 PM
Rosimbung Rai
Rosimbung Rai - avatar
6 Answers
+ 1
Do this to find out:go to Python for Beginers and look for the project in module 1(Variables).
25th Jun 2022, 5:39 PM
Rosimbung Rai
Rosimbung Rai - avatar
+ 1
Please explain what you are trying to do? Whats the desired input and what should happen and be the output from the code script
25th Jun 2022, 11:54 AM
Amaani
Amaani - avatar
0
Please help me if you can.I have already answered you.
4th Jul 2022, 2:09 AM
Rosimbung Rai
Rosimbung Rai - avatar
0
Hi, my bad I had notifications slienced for this app. In your code you have put bill = int(input(25.0)) This isn’t incorrect but I think you are misunderstanding how input() works When you use input() it will prompt the user running the script to type something and enter it. The variable, in this case it is called bill, will be assigned that user inputted value. By default the user input value will be string (str) type so you are correct using int() to convert the input type from string to integer (int). So we can use it as a number not text Any thing put inside brackets of input() will show when that line is read. Example if I have the code name = input(‘what is your name?’) When the code is run, you will get a prompt saying ‘what is your name?’ And you can type your name. In sololearn this feature doesn’t work properly and the prompt text will show after you have entered your input instead of before. So ideally your first line should be bill = int(input()) OR bill = int(input(‘enter bill amount‘))
6th Aug 2022, 4:50 PM
Amaani
Amaani - avatar
0
The exercise asks us to find 20% of the bill amount and print the value Our bill is an int type so we can use it as a number a do calculations So lets do that: tax=0.2 #20% can be written as 20/100 or 0.2 print(bill * tax) #this will print the value of bill amount * tax which is 0.2 That concludes the exercise Any other questions about this exercise feel free to ask
6th Aug 2022, 5:18 PM
Amaani
Amaani - avatar
0
Thanks a lot!
4th Sep 2022, 2:47 PM
Rosimbung Rai
Rosimbung Rai - avatar