>=
<=
=
!=
What will the following code output?
a=‘INFOMAX’ a=10 print(type(a))
<class 'int'>
<class ‘str'>
<class ‘bool'>
Error
val
raise
try
with
f = open("data.txt", "a")
f = Open("data.txt", "ab")
f= new("data.txt", "a")
open("data.txt", "a")
round(45.8)
round(6352.898,2,5)
round()
round(7463.123,2,1)
Class
List
Dictionary
Tuple
Use multiple write() statements.
Use writelines() method.
Use writeLine() method.
Use append() method.
String
raw_input
input
eval
accept
What will be the output of the following Python code?
x = "abcdef"while i in x: print(i, end=" ")
a b c d e f
abcdef
i i i i i i …
error
i = 1while False: if i%2 == 0: break print(i) i += 2
1
1 3 5 7 …
1 2 3 4 …
Nothing will be printed
Comments
Expressions
Tokens
Flow of control
What will be the output after the following statements?
a = 0b = 3while a + b < 8: a += 1 print(a, end='')
0 1 2 3 4
1 2 3 4 5 6
1 2 3 4 5
None of these
Read mode
Write mode
Append mode
Binary mode
What is the output of the following code ?
def fun(a, b=6): a=a+b print(a)fun(5, 4)
11
9
5
4
What value does the following expression evaluate to ?
x = 5while x < 10: print(x, end='')
Closed loop
one time loop
Infinite loop
Evergreen loop
ab
rw
r+
w+
list
tuple
class
dictionary
int
bool
void
None
Interface
Modularity
Client
Docstring
Passing –O when running python
Assertions are disabled by default
Both A and B are wrong
Assertions cannot be disabled in python
High Level
Object Oriented
Low Level
Both A and B
Comma Space Value
Comma Separated Value
Common spaced Value
Compact Structure View
Python Package Index
both a & b
none of the mentioned
File Found Error
File Not Exist Error
File Not Found Error
None of the above
What is the output of the following program:
i = 0while i < 3: print (i) i=i+1 print (i+1)
0 2 1 3 2 4
0 1 2 3 4 5
0 1 2 3
r
w
+
b
colon
comma
semicolon
hyphen
C
C++
JAVA
PHP
Yes
No
if / else not used in python
None of the above.
write()
append()
add()
insert()
What will be the output of the following Python code snippet?
print(not(3>4))print(not(1&1))
True True
True False
False True
False False
What will be the output of the following pseudocode, where ^ represent XOR operation ?
Integer a, b, cset b = 4, a = 3c =a ^ bPrint c
3
7
x=0if x: print("True")else: print("False")
True
False
What will be the output after following statements?
x = 2if x < 5: print(x)else: pass
2 3 4
1 2 3 4
2
None of These
32
10
i = 1while True: if i%2 == 0: break print(i) i += 2
1 2
1 2 3 4 5 6 …
1 3 5 7 9 11 … infinite time
Flexibility
Portability
Reliability
goto
except
What is the output of below program ?
def say(message, times =1): print(message * times)say("Hello")say("Word",5)
Hello WordWordWordWordWord
Hello Word 5
Hello Word,Word,Word,Word,Word
Hello HelloHelloHelloHelloHello
0
Free and Open Source
Freeware
Open source
Shareware
5 characters
5 words
5 lines
softspace
mode
closed
rename
What is the output of the following code?
x = 50def func (x): x = 2func (x)print ('x is now', x)
x is now 50
x is now 2
x is now 100
factorial()
print()
seed()
sqrt()
English
All of the above
Brackets
Indentation
Key
a=set('abc')b=set('cdef')print(a&b)
{'c'}
{'a','b','c','d','e','r'}
{c}
64
35
29