Skip to content

Instantly share code, notes, and snippets.

@PeterJatschka
Created September 2, 2016 07:24
Show Gist options
  • Save PeterJatschka/a4dfa37a68c787c68b04c617463d5cf5 to your computer and use it in GitHub Desktop.
Save PeterJatschka/a4dfa37a68c787c68b04c617463d5cf5 to your computer and use it in GitHub Desktop.
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:
print "fizz"
elif x%5 ==0 and x%3!=0:
print "buzz"
x +=1
else:
zahl = int(raw_input("Das ist nicht zwischen 1 und 100, gib eine Zahl zwischen 1 und 100 ein: "))
if zahl > 1 and zahl < 100:
print "Na also!"
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment