5
Filing cabinet:
101;Johnny 'wave-boy' Jones;USA;8.32;Fish;21
102;Juan Martino;Spain;9.01;Gun;36
103;Joseph 'smitty' Smyth;USA;8.85;Cruizer;18
104;Stacey O'Neill;Ireland;8.91;Malibu;22
105;Aideen 'board babe' Wu;Japan;8.65;Fish;24
106;Zack 'bonnie-lad' MacFadden;Scotland;7.82;Thruster;26
107;Aaron Valentino;Italy;8.98;Gun;19
Code:
arquivo = open("surfing_data.csv")
rexh = {}
for linha in arquivo:
(ID, nome, pais, média, prancha, idade) = linha.split(";")
rexh[ID] = nome,pais,média,prancha,idade
escolha = int(input("qual o id do surfista desejado : "))
How can I compare the keys of the rexh hash with the user input to get the right surfer id?
My idea is to compare the Ids (the numbers 101...107) with the user input to select and show the user the information (the hash values) for him of the respective surfer.