Skip to content
CampusEduX

Problem 4: Countdown with Early Stop

Easypython
Learn the Concept: Variables, Data Types, Loops

Problem Description

Write a Python program that counts down from a given starting number to 1 using a while loop, but stops immediately (using break) if it reaches a specific "skip number" provided by the user.

Input

Two integers: the starting number and the skip number.

Output

Each number from the countdown, printed one per line, stopping immediately when the skip number is reached (the skip number itself should NOT be printed).

Constraints

  • Starting number will be greater than the skip number.
  • Skip number will be a positive integer.

Example Input

text
7 3

Example Output

text
7 6 5 4

Concepts Covered

while loops, break, conditionals, counters.

Related Problems

Input (stdin)

Output

Run your code to see output here...