Exercises Python logo
Exercises Python
Course Practice Editor Get started free
  1. Python course
  2. Flow controls: Loops
  3. Descending odd numbers
26 Flow controls: Loops
Fundamentals concepts
  • The while loop
  • The for loop and range
  • Looping over strings with for
  • Counters and accumulators
  • break, continue and while True
  • Nested loops
  • Common mistakes with loops
Practice exercises
  • Char alphabet
  • Product of a number
  • Multiplication table
  • Prime number
  • Descending odd numbers
  • Return change
  • Product of prime factors
  • Using the while statement
  • While loop with validated input
  • Repeated number
  • Convert integer to binary and hexadecimal
  • Range of numbers
  • Multiples numbers
  • Hexadecimal table from 0 to 255
  • Access control
  • Infinite number sum
  • Infinite divisions
  • Infinite multiplication tables
  • Digits in a number
Flow controls: Loops · 12 / 26 Exercise Easy

Descending odd numbers

Objective

Write a Python program that displays odd numbers from x to y in descending order.

Input
49
3
Output
49 47 45 43 41 39 37 35 33 31 29 27 25 23 21 19 17 15 13 11 9 7 5 3

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise
← PreviousPrime number Next →Return change
Exercises Python logo
Exercises Python

Learn Python by solving practical exercises, free and right in your browser.

Get it on Google Play

Learn

  • Home
  • Course
  • Practice
  • Editor

More

  • Features
  • Contact

Account

  • Log in
  • Sign up

Legal

  • Privacy policy
  • Cookies policy
  • Terms and conditions
  • Cookie settings
  • Sitemap

© 2026. Made with 💙 by Jaracoder.

English
  • Español

We use necessary cookies to keep your session. With your consent we also use cookies for advertising and analytics, which keep the course free and help us improve it. Cookies policy