About 645,000 results
Open links in new tab
  1. python - While Loop / Continue Statement for Odd and Even Numbers

    Feb 10, 2019 · This is one way to do it with two while loops and two continue statements: n = 0 while n < 10: n += 1 if n % 2 == 0: continue print(n) while n > 1: n -= 1 if n % 2 == 1: continue …

  2. Python Program to Print Odd Numbers from 1 to N - Tutorial …

    Write a Python Program to Print Odd Numbers from 1 to N using While Loop and For Loop with an example. This Python program allows the user to enter the maximum limit value. Next, it is …

  3. Print Odd Numbers from 1 to 100 in Python – allinpython.com

    write a program to print odd numbers from 1 to 100 in Python using for-loop, while-loop, function, etc. with proper algorithm and explanation.

  4. Python Program to Print all Odd Numbers in a Range

    Nov 25, 2024 · There are several ways to print odd numbers in a given range in Python. Let’s look at different methods from the simplest to the more advanced. Using for loop with if condition. …

  5. Print Odd Number Between two Given Numbers Using While Loop in Python ...

    This program prints all the odd numbers between two given numbers using a while loop in python. Simple code: start = int(input("Enter the start number: ")) end = int(input("Enter the end …

  6. program in python to print odd numbers using while loop

    Core Requirements: Use a while loop to generate and print a series of odd numbers. Solution Approach: We'll initialize a counter and an odd number variable. The while loop will continue …

  7. Program to print odd numbers between 1 to n using While loop

    Dec 26, 2024 · Use a While loop to iterate through numbers from 1 to n. Check if a number is odd (number % 2 != 0). If true, print the number.

  8. Python Program to Print Odd Numbers From 1 to 100 - For Loop & While ...

    Aug 19, 2023 · Learn how to print odd numbers in Python from 1 to 100 with this step-by-step guide. Explore Python programs using for loops and while loops, plus variations and tips.

  9. Python while loop, print sequential odd numbers - Stack Overflow

    Apr 16, 2023 · The goal was to create a while loop in order to print every third sequential odd number between 2 and 19, inclusive. (The expected output is 7, 13, 19.) After some trial and …

  10. Print odd numbers from a list in python using while loop

    arr = [20, 33, 10, 22, 15, 34] n = 0 while(n < len(arr)): if (arr[n] % 2) != 0: print "Number is odd", arr[n] n += 1 else: print "Number is Even", arr[n] n += 1

  11. Some results have been removed
Refresh