0% found this document useful (0 votes)
58 views

FFFFF

The document contains 17 multiple choice questions related to Python programming concepts like data types, operators, functions and methods. The questions cover topics like strings, lists, tuples, dictionaries, logical and relational operators, random number generation and more.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

FFFFF

The document contains 17 multiple choice questions related to Python programming concepts like data types, operators, functions and methods. The questions cover topics like strings, lists, tuples, dictionaries, logical and relational operators, random number generation and more.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1 The output of the code will be :

s=“Wonders of World”
print(s.count(‘O’) + s.index(‘o’))
(a) 3 (b) 4 (c) 2 (d) 1
2 Which of the following are random number generators ? (a) randint() (b) randrange() (c) random() (d) All of these
3 Which of the following are sequence of character data? (a) Lists (b) Tuples (c) Strings (d) Dictionaries
4 State True or False “Multiple elements can be added at the end of list by the append method”.
5 These operators are used to make a decision on two conditions. (a) Logical (b) Arithmetic (c) Relational (d)
Assignment
6 a = 1.0
b = 1.0
a is b # Line 1
Output of Line 1 will be
(a) False (b) True (c) 1.0 (d) 0.0
7

8 Given L= [2,3,4,5,6]. The output of print(L[–2]) is (a) 6 (b) Error (c) 5 (d)
9 This function is used to calculate total occurrence of given elements of list. (a) len() (b) sum() (c) count() (d) extend()
10 You can repeat the elements of the tuple using which operator? (a) * (b) + (c) ** (d) %
11 Given a list Lst= [45,100,20,30,50]. What will be the output of Lst[: :]? (a) [45,100,20,30,50] (b) [ ] (c) Error (d) [45]
12 State True or False “Given a dictionary Studict. The statement Studict.items() displays the keys of the item only.
13 Which module is to be imported to use the floor() function? (a) statistics (b) matplotlib (c) random (d) math
14 Which function is used to convert string into tuple? (a) string() (b) tup() (c) tuple() (d) str_tuple()
15 State True or False “Lists and dictionaries are mutable.”
16 Which of the following is the correct output for the execution of the following Python statement?
print(5+3**2/2)
(a) 32 (b) 8.0 (c) 9.5 (d) 32.0
17 Observe the following tuples and choose the correct option
t1=(4, 7, 8, 9)
t2=(0, 4, 3)
>>>t=t1+t2
>>>print(t)
(a) (4, 7, 8, 9, 0, 4, 3) (b) (4, 7, 8, 9, 4, 7, 8, 9) (c) (4, 7, 8, 9) (d) None of these

You might also like