Class IX Robotics(Introduction to Data - Programming with Python) Lesson 4 Conditional Statements Session 2024--25
Class IX Robotics(Introduction to Data - Programming with Python) Lesson 4 Conditional Statements Session 2024--25
Video Tutorials:
Python Programming Tutorial - Control structures
Python Programming Tutorial - if else Statements
Python Programming Tutorial - Nested if statements | if elif else Ladder
if letter == "B":
print("letter is B")
else:
if letter == "C":
print("letter is C")
else:
if letter == "A":
print("letter is A")
else:
print("letter isn't A, B and C")
if letter == "B":
print("letter is B")
else:
print("letter isn't A, B or C")
Worksheet:
1. Write a program using python to read two int values from user and print the greatest
among them.
2. A company decided to give a bonus of 5% of salary to employee if his/her year of service
is more than 5 years. Ask the user for their salary and year of service and print the net bonus
amount.
3. Take input of age of 3 people by user and determine oldest and youngest among them.
4. A student will not be allowed to sit in exam if his/her attendance is less than 75%.
Take following input from user
Number of classes held
Number of classes attended.
And print
percentage of class attended
Is student is allowed to sit in exam or not.
5. Write a Python program to find those numbers which are divisible by 7 and multiple of 5,
between 1500 and 2700 (both included).
6. Write a Python program to check a triangle is equilateral, isosceles or scalene.
An equilateral triangle is a triangle in which all three sides are equal.
A scalene triangle is a triangle that has three unequal sides.
An isosceles triangle is a triangle with (at least) two equal sides.
7. Write a Python program to input a number from the user and check whether it is buzz
number or not.
8. Write a Python program to input a year and check whether it is leap year or not.