This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Tkinter | |
import random | |
import tkMessageBox | |
window=Tkinter.Tk() #erstellt fenster | |
#begruessungstext | |
greeting=Tkinter.Label(window, text="Guess the secret number") #weist den angegebenen text dem fenster "window" zu | |
greeting.pack() #setzt die zuweisung der oberen zeile um, ohne diese zeile bleibt das fenster leer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print "*Mein Finanzassistent*\nVerwalte deine Ausgaben" | |
list=[] | |
checklist=[] | |
keylist=[] | |
zwischensumme={} | |
summe=0 | |
y=0 | |
abgleich=0 | |
#Abfrage Ausgabearten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = raw_input("Willst du ein Geheimnis wissen? ") | |
while True: | |
if x.lower()=="ja" or x.lower()=="j": | |
print "Am 1.1. ist Neujahr" | |
break | |
elif x.lower()=="nein" or x.lower()=="n": | |
print "Ok, dann eben nicht..." | |
break | |
else: | |
while x.lower()!="j" or x.lower()!="ja" or x.lower()!="n" or x.lower()!="nein": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x=1 | |
zahl=int(raw_input("Gib eine Zahl zwischen 1 und 100 ein: ")) | |
while x < zahl: | |
if zahl >1 and zahl <100: | |
while x<=zahl: | |
if x %5 != 0 and x %3 != 0: | |
print x | |
elif x%5==0 and x%3==0: | |
print "fizzbuzz" | |
elif x%5!=0 and x%3==0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
secret=8 #geheime zahl definiert | |
guess=int(raw_input("Guess my secret number: ")) #abfrage tipp | |
if guess==secret: #entspricht eingabe der geheimen zahl, dann... | |
print "Congratulations, you are right!" | |
else: #entspricht eingabe nicht der geheimen zahl, dann... | |
print "Wrong! The number was",secret |