Python Programs Assignment
Python Programs Assignment
Solution
import random
n = random.randrange(1,10)
guess = int(input("Enter any number: "))
while n!= guess:
if guess < n:
print("Too low")
guess = int(input("Enter number again: "))
elif guess > n:
print("Too high!")
guess = int(input("Enter number again: "))
else:
break
print("you guessed it right!!")
11. Write a program in Python to find factorial for the given number using user
defined function
12. Write a Menu driven program to find the area of Circle, Rectangle and
Triangle using function
13. Writer a Menu Driven program to perform arithmetic operations((+,-,*, /,%)
using functions
14. Write a program to display the prime no’s in a given range using functions.