fizzbuzz

How to do FizzBuzz challange with python?

How to do FizzBuzz challange with python? Question: We have x number that goes 0 to 100. if x number divisible by 3 write ‘fizz’, if divisible by 5 write ‘buzz’ and if divisible by 3 and 5 write ‘fizzbuzz’. What is wrong with this code below? Code for FizzBuzz: i = 1 while i …

Total answers: 2

FizzBuzz list comprehension

FizzBuzz list comprehension Question: I was messing around with some different fizz buzz scripts as I learn python. I came across this one which works great but I can’t decipher how it works. I know how the normal fizz buzz works with a for loop and “if i % 3 == 0 and i % …

Total answers: 9

Trying to turn fizzbuzz into a function in python 3

Trying to turn fizzbuzz into a function in python 3 Question: I have only just started to learn python as my first language and whilst i worked out the code for fizzbuzz, i cannot for the life of me get it to do the items below. I also want it to print horizontally instead of …

Total answers: 13