[SOLVED] Ballpark order problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

[SOLVED] Ballpark order problem

I can't find the error Test 1 and 2 are passed but rest of three are failed (link)

4th Jun 2020, 8:02 PM
ABHISHEK
ABHISHEK - avatar
10 Answers
+ 1
ABHISHEK But if they don't order anything, you should by default add the equivalent of coke which is $5. Meanwhile, your code adds $4 if not found in dic.
4th Jun 2020, 9:35 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 2
Test 1 and 2 are passed but rest of three are failed
4th Jun 2020, 8:34 PM
ABHISHEK
ABHISHEK - avatar
+ 2
ABHISHEK I had to format the output to show only two digits after the comma, in order to pass. Maybe that's the problem? {:.2f} Plus: - coke is $5 not $4 - do not iterate to a fixed range of 4, but in the total length of the input.split list
4th Jun 2020, 9:00 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
JME Still Not working Maybe bcoz they are making four orders range is not problem Something else is wrong
4th Jun 2020, 8:26 PM
ABHISHEK
ABHISHEK - avatar
+ 1
JME this is main problem xD coz i don't know either what i m doing wrong and what i need to solve Btw thanks for looking into this :-)
4th Jun 2020, 8:42 PM
ABHISHEK
ABHISHEK - avatar
+ 1
Kuba Siekierzyński I tried but it is still not solved And i looked again in code coke is already 5
4th Jun 2020, 9:15 PM
ABHISHEK
ABHISHEK - avatar
0
Kuba Siekierzyński Oh sorry i missed that It is solved now thank you!
4th Jun 2020, 10:11 PM
ABHISHEK
ABHISHEK - avatar
0
@ABHISHEK I'm having the same issue. Can you share what you did differently to solve the last 3 tests?
2nd Nov 2020, 4:35 PM
Paige Wu
Paige Wu - avatar
0
Paige Wu I don't have pro subscription and I don't remember this now but maybe i could help if you add your solution and question
2nd Nov 2020, 5:10 PM
ABHISHEK
ABHISHEK - avatar
0
https://code.sololearn.com/cS8dMr5Fm42n/?ref=app ABHISHEK you can use my code, it has passed all test
21st Apr 2023, 8:11 AM
Ayush Ghara
Ayush Ghara - avatar