You are on page 1of 5

Question Answer1 Answer2

Which one of the following is the correct extension of the


1 .python .pyt
Python file
Which of the following declarations is incorrect in python x y z p = 5000
2 xyzp = 5,000,000
language? 6000 7000 8000
Which of the following operators is the correct option for
3 a^b a^^b
power(ab)?
Which one of the following has the highest precedence in
4 Division Multiplication
the expression?

Lists are mutable and Lists are faster and


5 What’s the main difference between Python lists and tuples?
tuples are immutable. tuples are slower.

Which of the following options will not result in an error


6 tupl[1]=2 tupl.append(
when performed on tuples in Python where tupl=(5,2,7,0,3)?

All elements in a list A given object may


7 Which of the following are true of Python lists? must be of the same appear in a list more
type than once
How to get last element of list in python? Suppose we have
8 arr[0] arr[5]
list with name arr, contains 5 elements.

9 Which one of the following is mutable data type? str set

What will be the output of the following code? arr =


10 [1,3,5] [2,4,6]
[1,2,3,4,5,6] print(arr[::2])
Which of the following data type is used to store values in
11 List Tuple
Key & Value format?
Which of the following statements is used to create an
12 [] ()
empty set?

In python, explicit Mutable data types


Which one of the following is False regarding data types in
13 data type conversion is are those that can be
Python?
possible changed.

Which of the following Python code will give different


14 for i in range(0,5): print(i)
output from the others?
No loop can be
Loops should be
used to iterate
15 Which of the following is True regarding loops in Python? ended with keyword
through the elements
"end".
of strings.

16 Which one of the following is a valid Python if statement : if a>=2 : if (a >= 22)

17 Which statement will check if a is equal to b? if a = b: if a = c:

18 What is the maximum possible length of an identifier? 32 characters 64 characters

256 128
19 What is the value of the expression 2**2**3**1?
Which of the following words cannot be a variable in
20 _val val
python language?
Division, Power, Division and
Multiplication, Multiplication
Addition and
21 Which one of the following has the same precedence level?
Subtraction

A tuple can contain A tuple can contain


22 Choose the correct option with respect to python. only integers as its only strings as its
elements elements
A tuple can contain A tuple can contain
23 Choose the correct option with respect to python. only integers as its only strings as its
elements elements
Suppose a list with name arr, contains 5 elements. You can arr[-2] arr[2]
24
get the 2nd element from the list using:
Suppose a tuple arr contains 10 elements. How can you set arr[4] = 'Hello' arr(4) = 'Hello'
25
the 5th element of the tuple to 'Hello'?
What is the output of the following program : print((1, 2) + (1, 2), (3, 4) (4,6)
26
(3, 4))
The values of a The keys of a
dictionary can be dictionary can be
27 Which of these about a dictionary is false? accessed using keys accessed using
values

Which of the follwing are the keys in the given statement : 10, 20 first, second
28
abc = {"first":10, "second":20}
[1,1,2,3,4,2,3,4] {1,2,3,4}
29 What is the output of following: set([1,1,2,3,4,2,3,4])

Which of the following function is used to know the data datatype() typeof()
30
type of a variable in Python?
What will be the output of the following Python code? for i Hello HelloHello
31
in range(0,2,2): print("Hello")
When break statement When loop
32 When does the else statement written after loop executes? is executed in the loop condition becomes
false

Loops are used to While loop is used


33 Which of the following is False regarding loops in Python? perform certain tasks when multiple
repeatedly. statements are to
executed repeatedly
until the given
condition becomes
False
Topic: Main test
Answer3 Answer4 Answer5 CorrectOption Topic

.ptn .py Answer4

x,y,z,p = 5000, x_y_z_p =


Answer2
6000, 7000, 8000 5,000,000

a**b a^*b Answer3

Parentheses Power Answer3

Lists can hold any


Lists are
data type and tuples
immutable and Answer1
can only contain int
tuples are mutable.
and str objects.

tupl1=tupl+tupl tupl.sort() Answer3

A list may contain These represent the


any type of object same list: ['a', 'b', Answer2
except another list 'c'], ['c', 'b', 'a']

arr[-1] arr[last] Answer3

tuple int Answer2

[1,2] [5,6] Answer1

Dictionary Set Answer3

{} set() Answer4

Immutable data Mutable data types


types are those that are those that can be Answer4
cannot be changed. changed.
3) for k in 4) for l in
2) for j in Correct
print(j) [0,1,2,3,4,5 range(0,5,1
[0,1,2,3,4]: Keyword print(k) print(l) option: 4
]: ):
Keyword "break" "continue" is used to
can be used to bring continue with the
Answer3
control out of the remaining
current loop. statements inside the
loop.
if (a => 22) if a >= 22 Answer1

if a == b: if a != b: Answer3

128 characters No specific length Answer4

64 12 Answer1
try _try Answer3

Subtraction and Power and Answer2


Division Division

A tuple can contain A tuple can contain


both integers and either string or
Answer3
strings as its integer but not both
elements at a time
A tuple can contain A tuple can contain Answer3
both integers and either string or
strings as its integer but not both
elements
arr[-1] atarr[1]
a time Answer4

arr[5] = 'Hello' Elements of a tuple Answer4


cannot be changed
(1, 2, 3, 4) Invalid Syntax Answer3

Dictionaries are not Dictionaries are Answer2


ordered mutable

first, 10, second, 20 first, 20 Answer2

{1,1,2,3,4,2,3,4} Invalid Syntax Answer2

type() vartype() Answer3

No Output Error Answer1

Else statement is When continue Answer2


always executed statement is
executed in the loop

While loop is used for loop can be Answer2


when multiple used to iterate
statements are to through the elements
executed repeatedly of lists.
until the given
condition becomes
True.

You might also like