+ 1
Tip Calculator: Test Case 3
Hey all, I cannot figure out the third test case for the Python for Beginners lesson 20 a.k.a. The tip calculator. My code: bill = int(input()) print(float(bill*0.2)) This☝🏼unlocked the Test Cases 1 & 2. I looked up and tried other code for this challenge but they still don’t solve for 3.
15 Antworten
+ 2
Yeah, maybe a bug.
Somehow, try again later even if this is not working
print(int(input())*0.2)
+ 2
Yes it's the brain stormer which makes us go crazy like why the heck I can't see my own project's answers
+ 1
James Shin
No need to convert in float because 0.2 will automatically convert. So just do this:
print(bill * 0.2)
+ 1
bill = int(input())
print(float(bill*20/100))
use this it works (for me though)
and upvote if you get the correct in TC3.
+ 1
so you mean you've already passed but you didn't knew about it though
+ 1
both are same
+ 1
Aashay yes. The UI shows a check mark, but it is “locked” so I cannot see the input or output for that third test case
+ 1
Aashay
If you can see all test cases then you can write Hard Code logic which may not be right because you may solve few test cases but if we try to put another test case so there maybe less chance to have a correct logic. That's why test cases are hidden so you can write correct logic which may satisfy condition for 1000 test cases.
+ 1
I think the third case is literally a check of how you've written it and not any integer values so that they don't show it.
0
Simba Nice catch! I actually did make sure to have that last parentheses in my original code. I just forget here I guess 😂 Edited with the correction, but TC3 remains locked 🤔
0
Simba I did! I literally copied and pasted your reply and it didnt work for TC3 maybe my app is just glitchy..
0
A͢J oh yeah, you’re right! I totally forgot that if int*float, output = float. Did I paraphrase that correctly?
Also, I still can’t get TC3 with anything proposed above. Problem remains unsolved. Maybe if someone provided the input for that..
0
James Shin
I this you are doing some mistake.
This code is working for me.
bill = int(input())
#your code goes here
print (bill * 0.20)
0
James Shin
No-one can see hidden test cases.