- 2
Hey Guys, for some code coach problems, I am getting the correct expected outputs in another IDEs, While SL IDE is showing error
Sololearn IDE is showing error for same inputs... I am using Pydroid (Python), it gives the correct expected output....
3 odpowiedzi
+ 2
Lakshya Mittal check the spelling for cheeseburger or cheseburger in description... I think you misspelled..
+ 5
Lakshya Mittal ,
sl has multiple sets of arguments (test cases) that are used for input() functions when code coach exercises are evaluated. some of them are so called edge cases, that may not be tested by you.
if you have any doubts, link your code here so that we can check it.
+ 1
# Nachos = Pizza = 6
# Cheseburger = 10
# Water = 4
# Coke = 5
List = ["Nachos", "Pizza", "Cheseburger", "Water", "Coke"]
Total = 0
a = input().split()
for i in range(len(a)):
if a[i] not in List:
a[i] = "Coke"
for j in a:
if j == "Nachos" or j == "Pizza":
Total += 6
elif j == "Cheseburger":
Total += 10
elif j == "Water":
Total += 4
elif j == "Coke":
Total += 5
Tax = (Total*7)/100
print(Total + Tax)
# To sir Lothar...Here is the code for "Ballpark Orders" code coach problem in which all the test case are passed except Test case 2....