-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyFizzBuzz.py
24 lines (23 loc) · 875 Bytes
/
MyFizzBuzz.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
print "Welcome to my FizzBuzz game! What it does you ask? Simple, you enter a number from 1 to 100"
print "If a number is divisible with 3, it will say Fizz! and if a number si divisible with 5 it will say Buzz!"
print "If a number si divisible with 3 and 5 it will say FizzBuzz!"
answer = "Y"
while answer == "Y":
num = int(raw_input("Please punch in a number from 1 to 100!>>"))
for x in range(1, num + 1):
if (x % 3 == 0) and (x % 5 == 0):
print "FizzBuzz!"
elif x % 3 == 0:
print "Fizz!"
elif x % 5 == 0:
print "Buzz!"
else:
print x
while True:
print "would you like to play one more time?"
answer = raw_input().upper()
if answer not in "YN":
print "You have to type Y or N only"
else:
break
print "Thank you for playing."