os.chdir("Güvenlik_Hesaplar")
files = ''
dictionary = {}
ant = os.listdir()
dict_number = 1
i = 0
while i < len(ant): # If the variable 'i' is less than the length of my files
dictionary["{}" : ant[i].format(dict_number)] #e.g = '1': 'myfile.txt'
dict_number += 1
i += 1
Error:
File "C:\Users\Barış\Desktop\Python\prg.py", line 20, in passwordrequest
dictionary["{}" : ant[i].format(dict_number)]
TypeError: unhashable type: 'slice'
Can you help me to solve this, please? I am using Windows x64