1
Make a program that manages the result of the entrance exam. For your happiness, there is only one course and the course has 10 vacancies. The program must keep the list of the 10 classifieds. The program also keeps, in another list (of 20 positions), the waiting list, which contains the successful candidates, but in excess of the number of vacancies (if any candidate is classified give up, one of the waiting list will be called). The waiting list may have up to 20 candidates.
The program must request the applicant’s number and say:
(a) whether it has been classified, or
(b) if he is on the wait list, in this case, indicate where in the queue it is, or
(c) if he was not approved.
Example. Be the classifieds: 20 32 01 14 99 34 21 02 15 07
Be the waiting list (value -1 means there is no candidate): 08 04 10 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
Examples of queries are: Input / Output 01 "classified" 04 "number 2 on waiting list 97 "not approved"
What I could do:
numeroCandidato = int(input("Entre com o numero do candidato: "))
classificados = [20,32,1,14,99,34,21,2,15,7]
listaDeEspera = [8, 4, 10]
if numeroCandidato not in classificados:
print("nao aprovado")
You can [Edit] your question and add the code to at least one of your attempts. This will make it easier for us to guide you, knowing where you are going wrong. And this statement is very confusing to understand. Did you complete it or omit some parts? What information will the entry be? The candidate’s note? What will be the condition to define whether it has been classified?
– Woss
Good morning! So I tried to do the exercise but I did almost nothing... Now on the interpretation: The entry will be the candidate’s number, if the number you entered is in the list of classifieds, a message will appear saying that it has been classified. If you are on the waiting list, a message will appear stating the candidate’s position on the waiting list, and if the number is not on any of the waiting lists, it will appear that it has not been ranked. Theoretically this is how the functionality.
– Pigot
If you did almost nothing, you must have done something. Start posting this something, at least to know if you started on the right track.
– Woss
I posted as far as I could, I can’t get out of there
– Pigot