tutorial |
---|
This is a typical beginner test that is required to complete interviews at Google, Facebook and all the other big tech companies.
-
Write the code needed to print in the console all the numbers from 1 to 100.
-
For multiples of 3, instead of the number, print "Fizz".
-
For multiples of 5, print "Buzz".
-
For numbers that are multiples of both 3 and 5, print "FizzBuzz".
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
....
....
98
Fizz
Buzz
There's a series of exercises dedicated to Lists and Loops, we encourage you to go and finish them before continuing: https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises
Then, come back! 😊
-
You have to use multiple
if
statements. -
Think about the correct order of the different
if
statements to make the code do what you want.