< Kurs:Python < LG < Py2009

Ein- und Ausgabe

# wort = 'Wort'                       # Wichtig bei Strings ist ' ... ', die Variable muss vor Verwendung allerdings nicht initialisiert werden.

while True:
    wort = raw_input ("Geben Sie ein Wort ein: ")
    print wort

String und Zahlen?

while True:
    wort = raw_input ("Geben Sie ein Wort ein: ")
    print wort
    wort = 4    
    print wort + 1

Würde man wort = 4 weglassen, gäbe es spontan eine Fehlermeldung. Total spontan dann :-)

This article is issued from Wikiversity. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.