#!python # -*- coding: utf-8 -*- import string import unicodedata import time with open('poeme', 'r') as tete: poeme = tete.read() lines = poeme.splitlines() print('If you want to know what sentence fits best with your personality, tell me where you were born.') city=input() city=unicodedata.normalize('NFD', str(city)).encode('ascii','ignore') #ignorer accents + convertir lettres city=str(city).lower() #ignorer maj asciiChars=list(string.ascii_lowercase) cityNbr = 0 for counter in range(0, len(city)): letterSearch=city[counter] for counter2 in range(0,len(asciiChars)): theLetter=asciiChars[counter2] #print("looking for" + letterSearch + "current letter :" +theLetter) if(theLetter == letterSearch): cityNbr = cityNbr + counter2 break #print(cityNbr) while cityNbr >= 14: cityNbr = cityNbr-14 print('The sentence that fits you most is : ' + lines[cityNbr]) print('Now, if you want to know what your astrological word is, tell me how old you are.')