I am new to python so excuse my stupidity. I am trying to iterate over a dictionary that is in a file (.txt). However, I only want to iterate over the keys from the dictionary, not the values. I have been trying for hours but have made no progress. Thanks for the help.
kluizen = {
11;kaasstengel,
1;geheim,
5;kluisvanpietje,
12;z@terd@g
} #the number of a locker with the password afterwards.
f = open('fa_kluizen.txt', 'r')
contents = f.read()
print(contents)
for numbers in contents: print(numbers)
f.close()
for key in dictionary:If you iterate over a dictionary, you get the keys.