Is there any error in it?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is there any error in it??

a = input().split(",") b = input() for i in a: if b in i: s = int(a.index(i))+1 print(int(s)*5) You are robbing a bank, but you’re not taking everything. You are looking for a specific item in the safety deposit boxes and you are going to drill into each one in order to find your item. Once you find your item you can make your escape, but how long will it take you to get to that item? Task Determine the amount of time it will take you to find the item you are looking for if it takes you 5 minutes to drill into each box. Input Format A string that represent the items in each box that will be drilled in order (items are separated by a comma), and secondly, a string of which item you are looking for. Output Format An integer of the amount of time it will take for you to find your item. Sample Input gold,diamonds,documents,Declaration of Independence,keys Declaration of Independence Sample Output 20

24th Jul 2021, 12:14 PM
Shahir
Shahir - avatar
2 Answers
+ 3
Shaik.Shahir Use '==' instead of 'in' in line four. Here's a simplified version: print((input().split().index(input()) + 1) * 5) # Hope this helps
24th Jul 2021, 12:17 PM
Calvin Thomas
Calvin Thomas - avatar
+ 1
👍👍👍
24th Jul 2021, 12:19 PM
Shahir
Shahir - avatar