+ 3

# what is wrong in this driver license code coach problem?

3 and 5 case are printing errors 1,2,4 cases are working. can anyone tell me why? https://code.sololearn.com/cq0qcDb6D7R1/?ref=app

8th Aug 2020, 12:25 PM
Mr. 12
39 Respostas
0
Thank You All, My Code Is Working Fine. I have solved The Bug.
10th Aug 2020, 6:10 AM
Mr. 12
+ 6
Mr. 12 No, it's not like that. Each agent serves one person at a time, so A and C are served "simultaneously". So, 20 min. Then, if there are 3 agents, then it would take only 20 min, as E would be served in first round!
8th Aug 2020, 2:20 PM
777
+ 5
Mr. 12 isn't round = (place // agents) + 1
8th Aug 2020, 3:12 PM
777
+ 4
Mr. 12 the situation is that, the persons are served alphabetically. Each agent serve one person at a time. And, one round takes 20 min. In the example, A and C are served in first round which takes 20 min, and then E (you) and F gets served. This takes another 20 min. Finally, you have license, after 40 min!
8th Aug 2020, 1:50 PM
777
+ 3
Time to process a licence is always 20 minutes, regardless of the number of agents. Remember, the licence is being given to you by the agent that is serving & the process takes 20 minutes. If there were more agents than customers, then the other agents would be drinking tea
8th Aug 2020, 12:49 PM
Rik Wittkopp
+ 3
Mr. 12 We can't provide you with a complete Code Coach solution as Sololearn has presented these as personal challenges. We can only try to guide you. The difficulties you encounter while trying to solve the problems help re-inforce the learning process
8th Aug 2020, 1:23 PM
Rik Wittkopp
+ 2
20 mins not 10 mins
8th Aug 2020, 12:46 PM
The future is now thanks to science
+ 2
you can divide with the agents to find out the lowest time but note that 20 minute is atleast.
8th Aug 2020, 12:49 PM
The future is now thanks to science
+ 2
Rik Wittkopp i am not asking your code and i dont want anyone code. i am saying, i think i didn't understand the problem well, Just explain Me The Problem. ** I am Not Asking Code ** i didn't understand about agents in the problem
8th Aug 2020, 1:29 PM
Mr. 12
+ 2
Mr. 12 ,see @RahulVerma comments.
8th Aug 2020, 1:58 PM
The future is now thanks to science
+ 2
sum =0; for i in range (0,place,agents): sum += 20 print(sum)
9th Aug 2020, 6:44 PM
MOHAMMED MOTASIM HAMED
+ 2
10th Aug 2020, 4:45 AM
Prabhakar Mishra
+ 1
Mr. 12 Your rounding function could either round Up or round DOWN depending on the fraction generated by your previous line of code. Inspect that element and adjust your code to suit.
8th Aug 2020, 12:29 PM
Rik Wittkopp
+ 1
You might wish to investigate the ceil function. import math math.ceil(func)
8th Aug 2020, 12:33 PM
Rik Wittkopp
+ 1
Rik Wittkopp can we do without importing math? , because i haven't learned all about math
8th Aug 2020, 12:37 PM
Mr. 12
+ 1
Mr. 12 ,note that it will take time at least 20 minutes to give new driver licence .Now figure yourself what's wrong.
8th Aug 2020, 12:39 PM
The future is now thanks to science
+ 1
Mr. 12 You don't need to learn all about something to use it. Google the bits you need and then implement it, that way you will learn bit by bit.
8th Aug 2020, 12:41 PM
Rik Wittkopp
+ 1
yes Rik Wittkopp , if it is our turn to get license, it will add 20 mins and calculate the time with no. of agents. but if we come first order, we got 2 agents, then time will be 10mins or 20mins ?
8th Aug 2020, 12:45 PM
Mr. 12
+ 1
so, we dont have to divide with the agent?
8th Aug 2020, 12:47 PM
Mr. 12
+ 1
Samsil Arefeen Rik Wittkopp this? import math you = input() agents = input() fourpersons = input().split() fourpersons.append(you) count = 0 print(fourpersons) for person in sorted(fourpersons): if person == you and count ==0 : count += 20 print(count) quit() elif person == you and count > 20: count += 20 count /= int(agents) print(math.ceil(count)) quit() else : count += 20 https://code.sololearn.com/cu5YGkH34une/?ref=app
8th Aug 2020, 12:56 PM
Mr. 12