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

New Driver's License

I passed the 3 tests but I am failing the first and second one why? (In python)

19th Nov 2021, 5:13 PM
Aditya Pardeshi
Aditya Pardeshi - avatar
4 Answers
19th Nov 2021, 5:13 PM
Aditya Pardeshi
Aditya Pardeshi - avatar
+ 1
Line 12 needs attention. Think of the agents taking groups of n people at a time. The calculation should include division.
20th Nov 2021, 4:57 AM
Brian
Brian - avatar
+ 1
Nice
21st Nov 2021, 8:55 AM
Aditya Pardeshi
Aditya Pardeshi - avatar
+ 1
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:28 PM
Mas'ud Saleh
Mas'ud Saleh - avatar