0
Is there anyone to help me for solving a code project?
Guys I could solve the third code project of python for beginner called tip calculator but it doesn't accepted , I don't know what's wrong because my input and output are somthing that is expected. I inserted the code below Would you help me please? What should I do? bill = int(input()) #your code goes here bill = 125 tip = 33 x=bill % tip x-=1 print (float(x)) #your code goes here input = int(268) output = int(70) y = int(input) % int(output) y-=4.4 print (float(y))
11 Answers
+ 5
It doesn't work there because I did not write the code to suit the challenge, but to show you how YOU may resolve this.
+ 2
You have misunderstood the function of input()
input() creates a user interface so the user may input information into the code.
The code will then operate upon that information.
input() -> string
int(input()) -> integer
float(inpit()) - float
an example of your code:
bill = int(input())
tip = float(input())
amount = bill * tip /100
print(amount)
+ 1
Sajjad Okay, but what's the question?
+ 1
Would you check this section in python beginner and insert these code ,there will exposure an error
My question is why it occurs?
+ 1
Sajjad Please type out a part of the question here.
+ 1
Your code should only ask for one input, which is the bill total. The tip is to be calculated in the program, it is not something that is for input.
+ 1
Sajjad Could you please type out the question? I mean, how do you determine the tip? Thank you.
+ 1
Ok never mind it
totally it works
Thank you all
0
Your programme needs to take the bill amount as input and output the tip as a float
The first input must be 125 and output 25.0
The second input must be 268 and output 53.6
And if you check I did it true but something goes wrongđ„đ„
0
Yes you're right but unfortunately it doesn't work there I don't know why
- 4
Calvin would you connect with me on whatsapp please ? just for sending something about question