Driver's new licence bug | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Driver's new licence bug

Can someone help me to solver the bug thank you! https://code.sololearn.com/cmRM5OYtpUbI/?ref=app

26th Feb 2020, 12:35 PM
Othmane DAHI
Othmane DAHI - avatar
8 Answers
+ 3
😄😉😉😉
28th Aug 2020, 5:31 AM
ヒトリ
ヒトリ - avatar
+ 2
Your "ppl" list isn't a list of names, but a list of characters. Instead of looking like this ['Alice', 'Bob'] it looks like this ['A', 'l', 'i', 'c', 'e', ' ', 'B', 'o', 'b'] To solve this, change line 4 to ppl = input().split()
26th Feb 2020, 2:36 PM
Diego
Diego - avatar
+ 2
#That’s mine, works well and in 6 lines name = input() agent = int(input()) client = list(input().split()) client.append(name) client.sort() print(int(client.index(name)//agent)*20 + 20) #hope it helped 😄
28th Aug 2020, 4:13 AM
ヒトリ
ヒトリ - avatar
+ 1
yep it works, That was when I just started python and programming so I didn't want to use any function pre-defined
28th Aug 2020, 5:30 AM
Othmane DAHI
Othmane DAHI - avatar
0
are u sure about this because i tried it already and it worked pretty well
26th Feb 2020, 3:37 PM
Othmane DAHI
Othmane DAHI - avatar
0
i didn't write for c in ppl L+=[c]
26th Feb 2020, 3:39 PM
Othmane DAHI
Othmane DAHI - avatar
0
i m counting the indexes of the non space characters of ppl by the variable co and then adding to the list ppl[i:co] with i initiated with 0 and changed to co when i add a string to the list
26th Feb 2020, 3:41 PM
Othmane DAHI
Othmane DAHI - avatar
0
myname = input() num_agents = int(input()) other_names = list(input().split()) other_names.append(myname) other_names.sort() ind_myname = other_names.index(myname)+1 print('20' if ind_myname <=num_agents else (ind_myname-num_agents)*20+20)
25th Nov 2021, 10:30 PM
Mas'ud Saleh
Mas'ud Saleh - avatar