- 2
Why this error as explained as comments
New Drivers License practice code
1 Resposta
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