Closed dizzy321 closed 3 years ago
the syntax error is at the = sign
Did you select the right language in Atom?
Yes. I am just starting, but i am running python3 as far as I know.
This is the entire code from a python tutorial page:
import random
print("hangman in Python")
woerter = 'Hund Katze Maus Haus raus'.split()
erraten = []
nutzereingabe = ""
fehlversuche = 7
ratewort = random.choice(woerter)
for buchstaben in ratewort:
erraten.append('_')
while nutzereingabe != "bye":
for ausgabe in erraten:
print (ausgabe, end=' ')
print()
nutzereingabe = input("Ihr Vorschlag: ")
x = 0
for buchstaben in ratewort:
if buchstaben.lower() == nutzereingabe.lower():
print ("Treffer")
erraten[x] = buchstaben
x += 1
print()
# Kontrolle ob gewonnen
if '_' in erraten:
# print('Noch nicht gewonnen')
fehlversuche -= 1
if fehlversuche == 0:
print("Schade - verloren!")
break
else:
print("Gewonnen, das Wort war: ", ratewort)
break
ok github doesn't show it correctly. It's under this link at the bottom of the page. https://www.python-lernen.de/hangman-python-programmieren.htm
Here is how you format code on github: https://guides.github.com/features/mastering-markdown/
Add:
#!/usr/bin/env python3
to the top of your script to tell the editor what language it is.
thank you very much. that did it.
The following excerpt from a code gives me syntax error in atom using script-runner. In Idle it works fine. print (ausgabe, end=' ') syntax error ^