I was solving a collection of paiza level-up questions, but I didn't have a model answer, so I made it myself. The language is Python3.
Paiza's skill check sample problem Fizz Buzz (equivalent to paiza rank C) https://paiza.jp/works/mondai/skillcheck_sample/fizz-buzz?language_uid=python3 I couldn't see the problem statement without logging in. Registration is free and can be done immediately, so I recommend you to register for the time being.
fizz-buzz.py
N = int(input())
for i in range(1, N+1):
if i % 3 == 0 and i % 5 == 0:
print("Fizz Buzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
print("Buzz")
else:
print(i)
For the explanation, click here [https://qiita.com/rA9-S/items/9d1c4108e23dae56bfce)
https://qiita.com/KoyanagiHitoshi/items/3286fbc65d56dd67737c
Feel free to comment if you have any questions. I will answer as much as possible!
Recommended Posts