-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathfizzbuzz.py
More file actions
46 lines (42 loc) · 828 Bytes
/
fizzbuzz.py
File metadata and controls
46 lines (42 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
fizzbuzz.py
Author: <your name here>
Credit: <list sources used, if any>
Assignment:
Write a program that prints the numbers from 1 to 100. But for
multiples of three print “Fizz” instead of the number and for
the multiples of five print “Buzz”. For numbers which are multiples
of both three and five print “FizzBuzz”.
We will use a variation of this test in which the last number of
the series isn't necessarily 100, and the two numbers being tested
for multiples aren't necessarily three and five. For example, your
program should behave just like this:
How many numbers shall we print? 25
For multiples of what number shall we print 'Fizz'? 3
For multiples of what number shall we print 'Buzz'? 5
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
"""