Page 104 - Digicode_AI_class_7
P. 104
7. x = 31
if x > 10:
print("Above ten")
if x > 20:
print("and also above 20!")
else:
print("but not above 20.")
8. a = 200
b = 33
if b > a:
print("b is greater than a")
else:
print("b is not greater than a")
Experiential Learning
Competency-based/Application-based questions Information Literacy
Shweta was writing a program in which she wanted to execute a particular set of statements depending
upon a particular test condition. Which type of statements can she use for this?
Critical Thinking
code TASK
A. Write a program to:
1. calculate the area of a square.
2. add two numbers.
3. multiply two numbers.
4. area of a rectangle.
B. Write a program to:
1. 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).
2. calculate the area of square or circle according to the given input by the user. If the input is 1,
then calculate the 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.
3. find whether the given character is a vowel or not.
4. check if the input number is positive or negative.
5. input three numbers from the user, then print ‘You Won’ if the sum of input numbers is greater
than 1000.
102 DigiCode AI-VII

