0
I donât know what the code is for this
6 Answers
+ 1
Do this to find out:go to Python for Beginers and look for the project in module 1(Variables).
+ 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
0
Please help me if you can.I have already answered you.
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â))
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
0
Thanks a lot!