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))

14th Aug 2021, 6:11 AM
Sajjad
11 ответов
+ 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.
14th Aug 2021, 8:22 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 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)
14th Aug 2021, 8:10 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
Sajjad Okay, but what's the question?
14th Aug 2021, 6:59 AM
Calvin Thomas
Calvin Thomas - avatar
+ 1
Would you check this section in python beginner and insert these code ,there will exposure an error My question is why it occurs?
14th Aug 2021, 7:18 AM
Sajjad
+ 1
Sajjad Please type out a part of the question here.
14th Aug 2021, 7:41 AM
Calvin Thomas
Calvin Thomas - avatar
+ 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.
14th Aug 2021, 7:58 AM
Josiah Mathieu
Josiah Mathieu - avatar
+ 1
Sajjad Could you please type out the question? I mean, how do you determine the tip? Thank you.
14th Aug 2021, 8:25 AM
Calvin Thomas
Calvin Thomas - avatar
+ 1
Ok never mind it totally it works Thank you all
14th Aug 2021, 8:35 AM
Sajjad
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😥😥
14th Aug 2021, 7:58 AM
Sajjad
0
Yes you're right but unfortunately it doesn't work there I don't know why
14th Aug 2021, 8:21 AM
Sajjad
- 4
Calvin would you connect with me on whatsapp please ? just for sending something about question
14th Aug 2021, 8:28 AM
Sajjad