+ 6
This question is about New drivers licence program of code coach challenges.
Can anyone tell me what changes can i make becoz case 1 and 5 are not satisfied. alp='ABCDEFGHIJKLMNOPQRSTUVWXYZ' you=str(input()) officer=int(input()) names=str(input()) counter=0 y=0 z=0 for i in range(0,26,1): if you[0]==alp[i]: youHold=i for y in range(0,y<=youHold,1): for z in range(0,z<=len(names),1): if names[z]==alp[y]: counter+=1 time=((counter//officer)+1)*20 print(round(time))
2 Respuestas
+ 1
Hard to tell without test cases or clear aim. My guess would be try indenting the for statements further so it runs for each match of i.
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)