I can not solve this exercise. I need the letter that indicates the type of service (E, R or F) to be indicated in the same line as the other information, however, according to the inserted letter, the information requested is different, I do not know how to do it.
Exercise: Lava Management
Entry: Each entry line begins with a letter 'E', 'R' or 'F', indicating the type of transaction to be performed. If the transaction is of type 'E' (enter), the rest of the line will contain the first name of the client (without spaces), and what type of service to perform ('wax' or 'lavage'). If the transaction is 'R', the rest of the line will contain only the first name customer to have the car removed. Finally, the last line of the entry will always be type 'F', indicating the closing of the jet washer.
Output: For each transaction of type 'R', your program should print the last service which was performed on the car in question. If there is no car registered under the requested name, print 'User not registered'.
Example:
Entry:
And Walter Wax
R Heisenberg
R Walter
F
Output:
User not registered
wax
My code:
dicionario = {}
c=0
while c==0:
letra = input()
if letra=="E" :
nome, serviço = input().split()
dicionario.update({nome:serviço})
elif letra== "R":
nome1=input()
if nome1 in dicionario.keys():
print(dicionario[nome1])
else:
print("Usuário não cadastrado!")
elif letra=="F":
c=c+1