Tag Archives: Output Type

What is the output of the following code? Consider Python 2.7. filter_none edit close play_arrow link brightness_4 code print tuple[1:3] if tuple == ( 'abcd',… Read More
What will be displayed by the following code? filter_none edit close play_arrow link brightness_4 code def f(value, values):     v = 1     values[0] = 44 t = 3 v = [1, 2, 3] f(t, v) print(t, v[0]) chevron_right… Read More
What is the output of the following program : filter_none edit close play_arrow link brightness_4 code print 'abcefd'.replace('cd', '12') chevron_right filter_none (A) ab1ef2 (B) abcefd… Read More
What is the output of the following program : filter_none edit close play_arrow link brightness_4 code print 'abef'.partition('cd') chevron_right filter_none (A) (‘abef’) (B) (‘abef’, ‘cd’,… Read More
What is the output of the following program : filter_none edit close play_arrow link brightness_4 code print 'cd'.partition('cd') chevron_right filter_none (A) (‘cd’) (B) (”) (C)… Read More
What is the output of the following program : filter_none edit close play_arrow link brightness_4 code i = 0 while i < 5:     print(i)     i… Read More
What is the output of the following program : filter_none edit close play_arrow link brightness_4 code i = 0 while i < 3:      print i … Read More
What is the output of the following program : filter_none edit close play_arrow link brightness_4 code print '{0:-2%}'.format(1.0 / 3) chevron_right filter_none (A) 0.33 (B)… Read More
What is the output of the following program : filter_none edit close play_arrow link brightness_4 code print '{0:.2}'.format(1.0 / 3) chevron_right filter_none (A) 0.333333 (B)… 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 : filter_none edit close play_arrow link brightness_4 code def myfunc(a):     a = a + 2         a =… Read More