Skip to content

Tag Archives: Python-Output Type

What is the output of the following program : print 'abcefd'.replace('cd', '12') (A) ab1ef2 (B) abcefd (C) ab1efd (D) ab12ed2 Answer: (B) Explanation: The first… Read More
What is the output of the following program : print 'abef'.partition('cd') (A) (‘abef’) (B) (‘abef’, ‘cd’, ”) (C) (‘abef’, ”, ”) (D) Error Answer: (C)… Read More
What is the output of the following program : print 'cd'.partition('cd') (A) (‘cd’) (B) (”) (C) (‘cd’, ”, ”) (D) (”, ‘cd’, ”) Answer: (D)… Read More
What is the output of the following program : i = 0 while i < 5:     print(i)     i += 1     if i == 3:         break… Read More
What is the output of the expression : 3*1**3 (A) 27 (B) 9 (C) 3 (D) 1 Answer: (C) Explanation: Precedence of ** is higher… Read More
What is the output of the following program : def myfunc(a):     a = a + 2         a = a * 2     return a    print… Read More