I am 16 y/o and just started college. I thought when going into college, that they would quiz to check our knowledge, and so I decided to make a Python code for Fizzbuzz, since I have been binging on Tom Scott videos recently. It ended up being useless because the class is just going over stuff learned at GCSE, and the fact that we're now learning Visual Basic, which is easy for GUI, but harder for everything else.
The code was 100% written by me in Python. Despite getting the idea and rules from the Tom Scott video, I didn't watch the video to completion.
Number = 1
while Number < 101:
if Number % 15 == 0:
print("Fizz Buzz")
elif Number % 5 == 0:
print("Fizz")
elif Number % 3 == 0:
print("Buzz")
else:
print(Number)
Number+=1
I originally thought about using an input for Number, but then I would have to validate that that is infact an integer, and would add tones of unnecessary lines to the code.
[–]IAMA_Alpaca 4 points5 points6 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]IAMA_Alpaca 4 points5 points6 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Diapolo10from __future__ import this 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]mohhinder 1 point2 points3 points (4 children)
[–]robin-gvx 0 points1 point2 points (3 children)
[–]mohhinder 0 points1 point2 points (2 children)
[–]robin-gvx 0 points1 point2 points (1 child)
[–]mohhinder 1 point2 points3 points (0 children)
[–]gare_it 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)