0
[SOLVED]What's the problem with this code?
uname = input() agents = int(input()) q = input() bnames = q.split (" ") bnames.append(uname) bnames.sort() if bnames[0] == uname: j = 2 if bnames[1] == uname: j = 3 if bnames[2] == uname: j = 4 if bnames[2] == uname: j = 5 if bnames[4] == uname: j = 6 wait = (agents - j) * -20 if wait <= 1: print(0) else: print(wait) Coach code link : https://sololearn.com/coach/18/?ref=app
2 ответов
+ 4
x=str(input())
y=int(input())
z=str(input())
lst=z.split()
lst.append(x)
lst.sort()
num=lst.index(x)
print((num//y)*20+20)
+ 1
Ratnapal Shende your a life saver