Python Program to Print Odd Numbers from 1 to 100

preview_player
Показать описание
Hi,

In this video I tried to explain Python Program to Print Odd Numbers from 1 to 100

Buy Coding T-Shirt
===========================

Python Scripts
======================

Python Functions Solved
==========================

Python Programs Solved
============================

First used is series method and next using list comprehension to pring odd numbers.

Below is the program to print odd numbers from 0 to 100
--------------------------
print("Odd numbers from 1-100 are ...")
for x in range(1, 100+1, 2):
print(x)

List Comprehension Method.
--------------------------------------------
print("Odd nos from 1-100 are :", [x for x in range(1,100+1, 2)])

[using loop] Python Program to Print Odd Numbers from 1 to 100
--------------------------------------
print("Odd Numbers from 1-100 are ..")
for x in range(1, 100+1):
if x % 2 != 0:
print(x)

Using while loop
-----------------------------------------------
print("Odd Numbers from 1-100 are ..")
x = 1
while x replace_this_with_less_than_symbol= 100:
if x % 2 != 0:
print(x)
x = x+1

Thank you for watching this video.
Рекомендации по теме
Комментарии
Автор

Plz can you help with how to use loops ro display prime numbers from 1 to 100 in python

victorjohn
Автор

how we do find out how many odd numbers are in it with for

girisimakli
Автор

Hello how to use loops and display all the odd number from 1 to 100 in python?

jcanexxdevelite
Автор

Bro what about while loop in odd number?... can you help me

fitsquads
join shbcf.ru