STD 7 Term 2 Revision Worksheet Solution
STD 7 Term 2 Revision Worksheet Solution
3. List is a sequence of items separated by commas and the items are enclosed
in square brackets [ ].
Q.2. State whether the following statements are true or false. If false, write the
correct statement.
1. Alphanumeric doesn’t require quotes.
False. Alphanumeric values should be enclosed within quotes.
2. a=b is an example of equality operator.
False. a= =b is an example of equality operator.
Q.3. Do as directed.
1. Use any number as input and predict the output of the program. Write
the number used as input :
num=int(input("Enter any number"))
if(num%5==0):
print(num,"is divisible by 5")
else:
print(num,"is not divisible by 5")
Output
Enter any number 86
86 is not divisible by 5
2. Find out the error(s) from the following code. Mention the error with
its line number.
a=input("Enter the number1") #line1
b=input("Enter the number2") #line2
if a>b #line3
print(a,"is the greatest number") #line4
else b>a: #line5
print(b,"is the greatest number") #line6
Solution – 1. Colon is missing at the end of line 3.
2. Condition is not required after else in line 5.
Q.4. Answer the following questions.
1. Define Decision making statements in python.
Decision making statements allow you to decide the order of
execution of specific statements in your program.
2. List out the data types of Python.
Python has the following data types:
Numbers
String
List
Tuple
Set
Dictionary
Q5. Python Programs
1. Write a python program to accept two numbers from the user and find
whether both are equal or not.
a=int(input("Enter any number"))
b=int(input("Enter any number"))
if a==b:
print(“Both are equal”)
else:
print(“Both are not equal”)
2. Write a python program to input the base and height of the triangle.
Calculate and display its area with the formula: Area = ½ (base*height)
b=int(input("Enter the base"))
h=int(input("Enter the height"))
area=0.5*b*h
print("The area of the triangle is", area)
****