₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,330,237 members, 8,444,513 topics. Date: Monday, 13 July 2026 at 04:07 PM

Toggle theme

A Python Program That Prints The Integers From 1 To 100. But For The ....... - Education - Nairaland

Nairaland ForumNairaland GeneralEducationA Python Program That Prints The Integers From 1 To 100. But For The ....... (1159 Views)

1 Reply (Go Down)

A Python Program That Prints The Integers From 1 To 100. But For The ....... by OPTOSUN(op): 12:54pm On Jul 24, 2021
Write a python program that prints the integers from 1 to 100. But for multiples of three, print "Fizz" instead of the number, and for the multiples of five, print "Buzz". For numbers which are multiples of both three and five, print "FizzBuzz"
Re: A Python Program That Prints The Integers From 1 To 100. But For The ....... by mrphysics(m): 1:34pm On Jul 24, 2021
OPTOSUN:
Write a python program that prints the integers from 1 to 100. But for multiples of three, print "Fizz" instead of the number, and for the multiples of five, print "Buzz". For numbers which are multiples of both three and five, print "FizzBuzz"
It's too simple bro. You can write it yourself.

for i in range(1,101):
if (i%3 == 0 and i%5 == 0):
print( "FizzBuzz" )
continue
elif (i%3 == 0):
print( " Fizz" )
continue
elif (i%5 == 0):
print( "Buzz" )
continue
else:
print(i)
Result
1
2
Buzz
4
Fizz
Buzz
7
8
Buzz
Fizz
11
Buzz
13
14
FizzBuzz
16
17
Buzz
19
Fizz
Buzz
22
23
Buzz
Fizz
26
Buzz
28
29
FizzBuzz


Note: I copied 1-30. But the code will give you all the result.
Re: A Python Program That Prints The Integers From 1 To 100. But For The ....... by NDSMELODY(m): 3:26pm On Jul 24, 2021
mrphysics:
It's too simple bro. You can write it yourself.



Result
1
2
Buzz
4
Fizz
Buzz
7
8
Buzz
Fizz
11
Buzz
13
14
FizzBuzz
16
17
Buzz
19
Fizz
Buzz
22
23
Buzz
Fizz
26
Buzz
28
29
FizzBuzz


Note: I copied 1-30. But the code will give you all the result.
I think it should not display the numbers instead if the numbers are odd BTW 1 and 100,it shld display fizz at standard output
Re: A Python Program That Prints The Integers From 1 To 100. But For The ....... by mrphysics(m): 5:07pm On Jul 24, 2021
NDSMELODY:
I think it should not display the numbers instead if the numbers are odd BTW 1 and 100,it shld display fizz at standard output
I think I followed instruction bro.

He said he wanted to print integers from 1-100 with conditions.

I didn't read where he talked about odd numbers. Rather, multiples of 3 and/or 5
Re: A Python Program That Prints The Integers From 1 To 100. But For The ....... by NDSMELODY(m): 5:47pm On Jul 24, 2021
mrphysics:
I think I followed instruction bro.

He said he wanted to print integers from 1-100 with conditions.

I didn't read where he talked about odd numbers. Rather, multiples of 3 and/or 5
you are right sir,can you do that using java pl ?
Re: A Python Program That Prints The Integers From 1 To 100. But For The ....... by mrphysics(m): 7:54pm On Jul 24, 2021
NDSMELODY:
you are right sir,can you do that using java pl ?
No sir. I am not a programmer, I just know little and the one that could help me solve my problems.


But even if in Java, it's very simple to implement.

Just import the basic namespaces and then write a For Loop

for(i=1;i<=100; i++)

Enter the conditions

print
Re: A Python Program That Prints The Integers From 1 To 100. But For The ....... by NDSMELODY(m): 9:21pm On Jul 24, 2021
mrphysics:
No sir. I am not a programmer, I just know little and the one that could help me solve my problems.


But even if in Java, it's very simple to implement.

Just import the basic namespaces and then write a For Loop I have java but I don't how I would have replace those numbers with string
Re: A Python Program That Prints The Integers From 1 To 100. But For The ....... by NDSMELODY(m): 8:06am On Jul 25, 2021
OPTOSUN:
Write a python program that prints the integers from 1 to 100. But for multiples of three, print "Fizz" instead of the number, and for the multiples of five, print "Buzz". For numbers which are multiples of both three and five, print "FizzBuzz"
using java pl

Re: A Python Program That Prints The Integers From 1 To 100. But For The ....... by NDSMELODY(m): 8:07am On Jul 25, 2021
Continu

1 Reply

Bukola Saraki's Foundation Awards Scholarship To 100 University StudentsFG Increases Unity Schools’ Fees From ₦45,000 To ₦100,000Why Do Nigeria Borrow Money Whereby They Can Prints More Money.234

Why is it that ASUP rarely goes On strike while ASUU often go on strike?Stormlikes.com Review: Boost Your Instagram Presence With Authentic EngagementHelp Me Out Oo