File:
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 hash 'rexh' keys with the user input to get the 'surfer's 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 from the respective surfer.