Skip to content

Instantly share code, notes, and snippets.

@femiabimbola
Last active January 20, 2020 11:51
Show Gist options
  • Save femiabimbola/7bc44b49b2e9c61b3f9c8249a42d8e14 to your computer and use it in GitHub Desktop.
Save femiabimbola/7bc44b49b2e9c61b3f9c8249a42d8e14 to your computer and use it in GitHub Desktop.
How to print a range of number in reverse order with Python
maximum = int(input("Please Enter the Maximum integer Value : "))
minimum = int(input("Please Enter the Minimum integer Value : "))
if ( maximum < minimum):
print(" The maximum number should be greather than minimum number")
else:
print("List of Natural Numbers from {0} to {1} : ".format(maximum, minimum))
while ( maximum >= minimum):
print (maximum, end = ' ')
maximum = maximum - 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment