Why this error as explained as comments | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Why this error as explained as comments

New Drivers License practice code

31st Jul 2021, 8:54 AM
Muhammad saifullah
1 Answer
0
myname = input() agents = int(input()) othernames = input() names = othernames + ' ' + myname names = [name.lower() for name in names.split()] names.sort() print(names) # it prints ['aron', 'beccy', 'flemming', 'david', 'zubeidah'] #when index method is called as follows print(names.index(myname)) # it gives error saying 'zubeidah' not in list # this error occures only when using sololearn; # it is working when using other compiler than sololearn practice code inbuilt cases
31st Jul 2021, 10:30 AM
Muhammad saifullah