A Python program to check whether a given number is in between 1 and 10.

#to know if a given number is in between 1 and 10.
x = int(input("Enter a number: "))
if x>=1 and x<=10:
    print('You typed', x, "which lies between 1 and 10.")
else:
    print('You typed', x, "which does not lies between 1 and 10.")

OUTPUT:
Enter a number: 6
You typed 6 which lies between 1 and 10.

Related Examples

1. A python program to calculate the area of a circle.

2. A Python program to test whether a number is even or odd.

3. A Python program to accept a number from the keyboard and test whether it is even or odd.

4. A Python program to display and sum of a list of numbers using while loop.

Leave a Reply

Your email address will not be published. Required fields are marked *

Wordpress Social Share Plugin powered by Ultimatelysocial
Wordpress Social Share Plugin powered by Ultimatelysocial