Dictionary
String
Tuple
List
What will be the output of the following code?
f=open("demo.txt","r")print(f.tell())
1
2
-1
0
It is used for object serialization
It is used for object deserialization
All of the mentioned
None of the mentioned
100
128
256
No Limit
None
True
False
equal
>=
<=
=
!=
Variable
Literals
Identifiers
Comment
try
Brackets
Indentation
Catch
English
PHP
C
All of the above
f.reads()
f.read()
f.read(all)
f.read( *)
.
#
/
?
32
33
31
30
Positional
Keyword
Default
pi
anonymous
lambda
none of the above
What is the output of the following code ?
def disp(*arg): for i in arg: print(i)disp(name="Rajat", age="20")
TypeError
Rajat 20
Name age
None of these
read()
readline()
readlines()
load()
End of File
End of Line
End of Statement
End of program
What will be the output of the following pseudocode, where ^ represent XOR operation ?
Integer a, b, cset b = 4, a = 3c =a ^ bPrint c
4
3
5
7
Docstring
Python Package Index
both a & b
none of the mentioned
What will be the output of the following Python code?
x = "abcdef"i = "i"while i in x: print(i, end=" ")
no output
i i i i i i …
a b c d e f
abcdef
The variables used inside function are called local variables.
The local variables of a particular function can be used inside other functions, but these cannot be used in global space.
The variables used outside function are called global variables.
In order to change the value of global variable inside function, keyword global is used.
seek()
close()
tell()
What will be the output of the following Python code snippet?
x = 'abcd'for i in range(len(x)): i.upper()print (x)
a b c d
0 1 2 3
error
Hello
949227
"2'
5 characters
5 words
5 lines
None of the above
Python Interpreter.
Python compiler
Python Volatile machine
Portable virtual machine
f.seek(-10, 0)
f.seek(10,0)
f.seek(-10, 1)
Interactive Mode
Script Mode
Both Interactive Mode or Script Mode
None of These
Required arguments
Keyword arguments
Default arguments
Variable-length arguments
-100
-101
101
raise
goto
except
Class
What will be the output?
x = 10def fun(): global x x = 20fun()print(x)
10
20
Error
procedure
function
bug
n=5 while n>0: n-=1 if n==2: continue print(n,end=' ')
5 4 3 1 0
4 3 1 0
4 3 2
none of these
End Of Folder
Exit Open File
End Of File
Error On File
Lists
Tuples
Expression
Portability
Reliability
Combination of Interactive and Script modes
All of these
Comma Space Value
Comma Separated Value
Common spaced Value
Compact Structure View
int
bool
void
Interface
Modularity
Client
End of List
End of Loop
End of Language
or
and
not
31 characters
63 characters
No limit but 79 characters for better redability
All of the above.
Variable names in Python cannot start with number. However, it can contain number in any other position of variable name.
Variable names can start with an underscore.
Data type of variable names should not be declared.
None of the above.
i = 2while True: if i%3 == 0: break print(i) i += 2
2 4 6 8 10 …
2 4
2 3
a_=3
_a=3
a?=3
i = 1while False: if i%2 == 0: break print(i) i += 2
1 3 5 7 …
1 2 3 4 …
Nothing will be printed
def fun(a, b=5): print(a+b)fun(10, 20)
15
25