2026-27
Subject: Robotics and AI
WORKSHEET- 2
Python Programs
Class :IX
Q1 . Write a program to take input a number from the user and check the number is “Even” or “Odd”.
Q2. Write a program to find the smallest of two numbers input by the user
Q3. Write a program to check whether a number is divisible by 11.
Q4. Write a program to check whether a number is divisible by two, five or 7.
Q5. Write a program to check whether the 2 numbers input by the user are equal or print the greater
number.
Q6. Write a program to print the largest of 3 numbers input by the user.
Q7. Input the current temperature of the room from the user. Compare it with highest temperature which
is 51.2°C and lowest temperature which is 15.8°C for a city .Write a program which displays that the
current temperature recorded falls between highest and lowest temperature or not.
Q8. During a sale discounts are offered in accordance with the purchases made. Write a program to
calculate and print the discount earned and Net amount payable by the customer after applying the
discount.
Purchases (P) Discount (D)
P>=10000 25% of the purchases
P>=8000 and P<10000 20% of the purchases
P>=5000 and P<8000 15% of the purchases
P<5000 5% of the purchases
Q9. Write a program to print the Grades of the students on the basis of the marks he obtains.
Marks Grades
M>=75 A
M>=60 and M<75 B
M>=50 and M<60 C
M>=40and M<50 D
M<40 E
Q10. Write a Python program that takes weight (in kg) and height (in meters) as inputs,
calculates BMI, and prints the BMI category
BMI Range Category
Below 18.5 Under weight
18.5 to 24.9 Normal weight
25 to 29.9 Over weight
30 and above Obese
Q11. Write a program to check whether an entered ASCII code represents a digit, a lower case
character, Upper case character or a special character.
ASCII Range Character
48 – 57 Digits
65 – 90 Upper Case Character
97 – 122 Lower Case Character
Else Special Character
Q12. Write a menu –driven program to find the area of triangle and rectangle.
Q13. Input a number from the user and print whether it is Leap Year or not.