Python Programming Questions Formatted
Python Programming Questions Formatted
Ans. (b) in
Ans. (b) 0
Ans. (c) 15
10. The expression 8/4/2 will evaluate equivalent to which of the following
expressions:
(a) 8/(4/2) (b) (8/4)/2
11. Which among the following list of operators has the highest precedence?
(a) <<, >> (b) ** (c) | (d) %, /, *, +, -
Ans. (b) **
13. Which of the following statement prints the shown output below?
hello\example\test.txt
(a) print("hello\example\test.txt")
(b) print("hello\\example\\test.txt")
(c) print("hello\"example\"test.txt")
(d) print("hello\\example\"test.txt")
Ans. (b) print("hello\\example\\test.txt")
16. Which of the following four code fragments will yield following output?
Eina
Mina
Dika
Select all of the function calls that result in this output
(a) print('''Eina
Mina
Dika''')
(b) print('''EinaMinaDika''')
(c) print('Eina\nMina\nDika')
(d) print('Eina\nMina\nDika')
Ans. (a) //
18. For a given declaration in Python as s = 'WELCOME', which of the following will be
the correct output of print(E[1::2])?
(a) WEL (b) COME (c) WLOE (d) ECM
Ans. (b) in
3. A _____ is a word having special meaning and role as specified by programming language.
Ans. keyword
4. The data types whose values cannot be changed in place are called _____ types. Ans.
Immutable.
6. The explicit conversion of an operand to a specific type is called _____. Ans. type casting
8. A _____ statement skips the rest of the loop and jumps over to the statement following the
loop. Ans. break
9. The _____ statement skips the rest of the loop statements and causes the next iteration of
the loop to take place. Ans. continue
2. The value of the expressions 4/(3*(2–1)) and 4/3*(2–1) is the same. (TRUE)
3. The value of the expressions 4/(3*(4–2)) and 4/3*(4–2) is the same. (FALSE)
5. A string can be surrounded by three sets of single quotation marks or by three sets of
double quotation marks. (TRUE)
10. In a Python program, if a break statement is given in a nested loop, it terminates the
execution of all loops in one go. (FALSE)