Feb-21-2018, 01:23 AM
Hello im a Programming Beginner and learning form a book. Everything worked so far extemley well and im making Progress but this Python Script doesnt seem to work. I get syntax error on ELIF and i dont know why.
#initzialize random number generator import random random.seed() #init variables a = random.randint(1,100) b = random.randint(1,100) c = a + b #Question print ("Die Aufgabe lautet:", a, b) #userinput print ("Bitte Zahl eingeben:") zahl = input() zahl = float(zahl) #results if zahl == c: print("Super Das Ergebnis ist richtig") elif zahl < 0 or zahl > 100: print("Ganz Falsch") elif zahl c-1 <= zahl <= c+1: #in this line im getting syntax error. ELIF is red underlined. and i dont know why print("Du bist ganz nahe dran") else: print("Falsch")Thank You For your Help :)