Nov-17-2021, 09:35 PM
(This post was last modified: Nov-17-2021, 09:58 PM by Cicada3301.)
Excuse me for my ignorance, but I renamed the file with the mountains data to mountain3.txt,also changed the name of the file in the program but I am still getting :
update No2
FileNotFoundError: [Errno 2] No such file or directory: 'mountain3.txt'UPDATE: It's ok now with
with open ('mountain3.txt' ,'r',encoding = 'utf-8') as f : for z in f: y = z.split(',',maxsplit = 4) name = y[0] height = y[1] location = y[2] print(name,height,location)but the program doesn't do something
update No2
x = input('For which mountain do you want to learn ? :') with open ('mountain3.txt' ,'r',encoding = 'utf-8') as f : for z in f: y = z.split(',',maxsplit = 4) name = y[0] height = y[1] location = y[2] b = list(name) c = list(height) d = list(location) for i in range(len(b)+1): if x in d: print(name[i],height[i],location[i]) #still does not do something