On 22/04/22 5:09 am, Chris Angelico wrote:
This can't be your complete code, because it won't run like this.
Also, the output you showed contains blank lines and lines
with hyphens, and there is nothing in the code you posted
which does that.
If I had to guess, I'd say you have a loop which is
On Fri, 22 Apr 2022 at 04:19, Jack Dangler wrote:
>
>
> On 4/21/22 13:09, Chris Angelico wrote:
> > On Fri, 22 Apr 2022 at 03:02, Tola Oj wrote:
> >> for i in range(1, n+1):
> >> if i % 3 == 0 and i % 5 == 0:
> >> print("Fizzbuzz")
> >> elif i % 3 == 0:
> >>
On 4/21/22 13:09, Chris Angelico wrote:
On Fri, 22 Apr 2022 at 03:02, Tola Oj wrote:
for i in range(1, n+1):
if i % 3 == 0 and i % 5 == 0:
print("Fizzbuzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
print("Buzz")
On Fri, 22 Apr 2022 at 03:02, Tola Oj wrote:
>
> for i in range(1, n+1):
> if i % 3 == 0 and i % 5 == 0:
> print("Fizzbuzz")
> elif i % 3 == 0:
> print("Fizz")
> elif i % 5 == 0:
> print("Buzz")
> else:
> print(i)
>
given a number n, for each integer i in the range from 1 to n inclusive,
print one value per line as follows:
. if i is a multiple of both 3 but not 5, print fizz.
.if i is a multiple of 5 but not 3, print buzz
.if i is not a multiple of 3 or 5, print the value of i.
the above is the question. the