7 Question Bank
7 Question Bank
7th
a) 1995
b) 1972
c) 1981
d) 1989
2) Which one of the following is the correct extension of the Python file?
a) py
b) .python
c) ..p
d) None of these
a) Key
b) Brackets
c) Indentation
d) None of these
a) /
b) //
c) #
d) !
a) Object
b) Function
c) Attribute
d) Argument
9. Why does the name of local variables start with an underscore discouraged?
a) val
b) raise
c) try
d) with
11. Which of the following statements is correct for variable names in Python language?
a) _val
b) val
c) try
d) _try_
a) val()
b) print()
c) print()
d) None of these
15 round(4.576)ࣆࣆ
a) 4
b) 5
c) 576
d) 5
a) Indentation.
b) Key.
c) None of the above.
20.ࣆWhich of the following language does the computer understand?
a) Computer understands only C Language
b) Computer understands only Assembly Language
c) Computer understands only Binary Language
d) Computer understands only BASIC
a = [1, 2, 3]
a = tuple(a)
a[0] = 2
print(a)
a) [2, 2, 3]
b) (2, 2, 3)
c) (1, 2, 3)
d) Error.
Hide
22ࣆ What will be the output of the following code snippet?
print(type(5 / 2))
print(type(5 // 2))
a) float and int
b) int and float
c) float and float
d) int and int
Hide
23 Which of the following types of loops are not supported in Python?
a) for
b) while
c) do-while
d) None of the above
24 Which of the following is the proper syntax to check if a particular element is
present in a list?
a) if ele in list
b) if not ele not in list
c) Both A and B
d) None of the above
Hide
25 As what datatype are the *kwargs stored, when passed into a function?
a) Lists.
b) Tuples.
c) Dictionary.
d) None of the above.
26 What keyword is used in Python to raise exceptions?
a) raise
b) try
c) goto
d) except
27 Which of the following is not a valid set operation in python?
a) Union
b) Intersection
c) Difference
d) None of the above
Hide
28 Which of the following are valid escape sequences in Python?
a) \n
b) \t
c) \\
d) All of the above
Hide
29 Which of the following are valid string manipulation functions in Python?
a) count()
b) upper()
c) strip()
d) All of the above
Hide
30 Which of the following modules need to be imported to handle date time
computations in Python?
a) datetime
b) date
c) time
d) timedate
31 In which language is Python written?
a) C++
b) C
c) Java
d) None of these
a) bc
b) abc
c) a
d) bca
3)What is an operator?
Ans: Operators in Python are special symbols for carrying out arithmetic or logical calculations
Ans: Python is user-friendly and it is easier to write codes using Python rather than C++ and
Java. 2. What are the advantages of the Python language? Ans: Advantages of Python: o High-
level language o Interactive
6. What is a list?
Ans: Lists are used to store multiple items in a single variable
7. What is a dictionary?
Ans: Dictionary in Python is an unordered collection of data values, dictionaries are used to
store data values in key: value pairs.
8. What is turtle Programming?
Ans: Turtle is a feature in python that act as a Blank drawing Board. Turtle act like a pen.
Q.NO 2) Brief Ans
YY=2023
MM=10
PRINT(CALENDER,MONTH(MM,YY))
3.How to write program using the “for loop”to display the number?
Ans i)start.ii)create new file iii)type out a for loop setting the range as 40.
iv)allot variable to store the remainder v)type an if condition to check whether the remainder is
0.vi)type out a print statement within the if statement vii) rune module on IDLE .viii)stop.