Long time no see. This is gorira. I wrote a problem with the famous fizzbuzz. If you don't understand, try searching with hints.
python official manual If you pull this, you can see various examples. If you are in trouble because of a literal translation, please execute it appropriately. Let's decide whether to use it in the execution result. Since it's summer vacation, I studied Python with elementary school students --- Exercise 1 from FizzBuzz shakiyam There are people who are doing the same thing, so I can get on. I quoted it firmly.
Let's make a program that displays 1 to 20.
The renge function is useful for producing consecutive numbers. Let's find out.
Let's make a program that displays 1 to 20. However, if it is a multiple of 3, display it as Fizz.
Tips To realize "If ...", use an if statement. Use "%" to find the remainder of the division in Python.
Let's make a program that displays 1 to 20. However, display Fizz for multiples of 3, Buzz for multiples of 5, and FizzBuzz for multiples of 3 and 5. Hint Note the order of if statements. Afterword When you are done, please go to Answer Commentary. We will update it one by one.
Recommended Posts