Can someone help me? (IndexError: string index out of range)
GreeFoss
-
yg_be Posted messages 23437 Registration date Status Contributor Last intervention -
yg_be Posted messages 23437 Registration date Status Contributor Last intervention -
Bonjour, j'ai fait ce code basé sur la numérologie, mais lorsque je l'exécute, ça m'indique : IndexError : string index out of range
Quelqu'un pourrait m'aider?
Quelqu'un pourrait m'aider?
day=input() month=input() year=input() print("Day of birth:" + day + '\n' + "Month of birth:" + month + '\n' + "Current year:" + year + '\n' + "====================" + "\n" + "Magic Magic!" + '\n' + "====================") def numerology(): year2 = int(year[0]) + int(year[1]) + int(year[2]) + int(year[3]) year3 = str(year2 + int(day) + int(month)) year4 = str(int(year3[0]) + int(year3[1])) year5 = str(int(year4[0]) + int(year4[1])) print("Your personal year is... \n year " + year5 + '!') numerology()
1 answer
-
yg_be Posted messages 23437 Registration date Status Contributor Last intervention Ambassadeur 1 588
Je vous prie de me communiquer la demande de traduction ou de reformulation souhaitée.