Class 8 Computer CH 9 Worksheet
Class 8 Computer CH 9 Worksheet
CLASS: VIII
CHAPTER 9
Worksheet
1. Fill in the blanks. 1
a. command is used to display a statement in Python.
b. command can be used to take in a value from the user.
c. The keyword is used to display the data type of the variable.
d. The variables upon which an operator performs an operation are known as .
e. statements are used to perform an action based on a given condition.
a. The type of data contained in a variable that tells the computer what operations can be
performed on it is known as an operator.
b. The range function is used in Python for applying the for loop.
a. What is concatenation?
b. What is the need to use function?
c. Explain any four built-in functions.
for x in list1:
print(x)
n1 = 45
n2 = 30
if n1>n2:
return n1
else:
return n2
print(f1())
f. Write a function in Python that accepts a traffic signal colour and returns relevant message.
g. Create a list that contains 3 numbers and returns the maximum out of three entered numbers.
Worksheet
2
1. Fill in the blanks.
a. To display both text and variables in a line, they have to be separated by a in the print command.
b. To display the variable, the command is used.
c. is a symbol that tells the computer what operations are to be performed on the variable.
d. are actions that repeat themselves.
e. The function written by the user is called a function.
a. + is an arithmetic operator.
c. The While loop is a loop that repeats until the specified condition is true.
d. Once a function is defined, it can be called, that is, used in other parts of the program.
print (max(list1))
print (min(list1))
print (len(list1))
print (list1[len(list1)-1])
if n1==n2:
return True
else:
return False
n1 = 40
n2 = 30
print(f1(n1, n2))
f. Write a function in Python that accepts a number and print its multiplication table up to 10 terms.
g. Create a list that has names of your five friends. Ask user to enter a name and check whether that name exists in the list or not.