Answers for "loop odd numbers python"

1

python for loop even numbers

for i in range(2,11,2): # range(start, end, step)
  print(i)
Posted by: Guest on May-07-2021
0

while loop odd numbers python

# Python Program to Print Odd Numbers from 1 to N

maximum = int(input(" Please Enter the Maximum Value : "))

number = 1

while number <= maximum:
    if(number % 2 != 0):
        print("{0}".format(number))
    number = number + 1
Posted by: Guest on July-08-2021

Python Answers by Framework

Browse Popular Code Answers by Language