Page 141 - TP_Plus_v4_Class7
P. 141
2. Find the error in the following code and rewrite the code:
a. num = int(input("Enter a Number: "))
if (num > 5)
print("Number greater than five"):
elif (num < 5):
print("Number less than five")
else:
print("Wrong condition")
b. Marks = int(input("Enter the Marks: "))
if (marks < 33)
print("Fail")
else:
print("Pass")
3. Competency-based/Application-based questions:
a. You were writing a program in which you wanted to execute a particular set of statements
depending upon a particular test condition. Which type of statement will you use for this?
b. Swara wants to test multiple conditions in a program. But she is unable to identify which type of
statement she should use to do so. Help her by writing the correct statement.
21 st
DIY In The Lab Century #Critical Thinking
#Technology Literacy
Skills
To
Subject Coding
Go to your computer lab & do the following:
Write a Python program to:
a. check whether the year input by the user is a leap year or not. (a year is a Leap year, if the year is a
multiple of 4 and isn’t a multiple of 100 or if the year is a multiple of 400).
b. calculate the area of square or circle according to the given input by the user. If the input is 1, then
calculate area of square, else find the area of a circle. Ask the user to input the values for square or
circle, based on the input.
c. find whether the given character is a vowel or not.
d. input three numbers from the user, then print ‘You Won’ if the sum of input numbers is greater than
1000.
For The Teacher
Discuss all the topics covered in this chapter with the students.
Tell the students, how to use indentation to define the body of the conditional statement.
#Conditional Statements in Python 139

