+ 2

Hi, I need help for this code:

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 I tried to make a list with each item but It's wrong, pls can someone help me?

23rd Apr 2022, 2:42 PM
Edo
Edo - avatar
5 Antworten
+ 3
Hi! Can I see your attempt? Link it!
23rd Apr 2022, 2:44 PM
Per Bratthammar
Per Bratthammar - avatar
+ 3
You need take input for items as well as first input, then split by camma to make into a list.. No need loop. just the last line, single time is enough next.
23rd Apr 2022, 3:06 PM
Jayakrishna 🇮🇳
23rd Apr 2022, 2:53 PM
Edo
Edo - avatar
+ 1
The code I wrote functions, but when i write It to solve the exercise It says It's wrong
23rd Apr 2022, 3:01 PM
Edo
Edo - avatar
+ 1
Thx, i forgot there was the split function😅
23rd Apr 2022, 3:09 PM
Edo
Edo - avatar