=
!=
<>
=!
file_exists()
exists_file()
os.path.exists()
check_file()
.py
.python
.p
None of these
Required arguments
Keyword arguments
Default arguments
Variable-length arguments
What value does the following expression evaluate to ?
x = 5while x < 10: print(x, end='')
Closed loop
one time loop
Infinite loop
Evergreen loop
Lists
Dictionary
Tuples
Class
True
False
Infinite
NULL
w
rb
rt
r
High Level
Object Oriented
Low Level
Both A and B
reference_point indicates the current position of the file object
reference_point indicates the starting position of the file object
reference_point indicates the ending position of the file object
None of the above
float
str
set
int
1995
1972
1981
1991
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
not
or
and
xor
write
output
send
dump
write mode
read mode
append mode
Both (A) And (C)
What will be the output of the following Python code?
for i in range(5): if i == 5: break else: print(i)else: print("Here")
0 1 2 3 4 Here
0 1 2 3 4 5 Here
0 1 2 3 4
1 2 3 4 5
Comma Space Value
Comma Separated Value
Common spaced Value
Compact Structure View
What will be the output of the following code?
f=open("demo.txt","r")print(f.tell())
1
2
-1
0
What will be the output of the following code ?
f=open("demo.txt","w+")f.write("Welcome to python")f.seek(5)a=f.read(5)print(a)
Welco
me to
Welcome to Python
e to
a
f
t
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
10
1.0
def power(x, y=2): r=1 for i in range(y): r=r*x return r print(power(3)) print(power(3,3))
Option A
Option B
Option C
Option D
Interface
Modularity
Client
Docstring
8
Which of the following error is returned by the given code ?
f = open("test.txt","w")f.write(345)
Syntax Error
Type Error
String Error
Run Time Error
What will be the output of following?
Y=[2,5J,6]Y.sort()
[2,6,5J]
[5J,2,6]
Error
[6,5J,2]
Use multiple write() statements.
Use writelines() method.
Use writeLine() method.
Use append() method.
C
C++
JAVA
PHP
End Of Folder
Exit Open File
End Of File
Error On File
Interpreter
Compiler
Combination of Compiler and Interpreter
all of these
Read two words from file
Read two line from file
Read two character / two bytes
count the number of '2' in file
raw_input
input
eval
accept
Expression
Portability
Reliability
raise
goto
try
except
Variable
Literals
Identifiers
Comment
f.seek(-10, 0)
f.seek(10,0)
f.seek(-10, 1)
It is used for object serialization
It is used for object deserialization
All of the mentioned
None of the mentioned
String
Tuple
List
readlines()
readline()
readlist()
readall()
Brackets
Indentation
Key
x = 'abcd'for i in range(len(x)): print(i.upper())
a b c d
error
1 2 3 4
round(45.8)
round(6352.898,2,5)
round()
round(7463.123,2,1)
x = ['ab', 'cd'] for i in x: x.append(i.upper()) print(x)
[‘AB’, ‘CD’]
[‘ab’, ‘cd’, ‘AB’, ‘CD’]
[‘ab’, ‘cd’]
Infinite Loop
Python Package Index
both a & b
none of the mentioned
Comments
Expressions
Tokens
Flow of control
student
s12
123
_123
What will be the output of the following Python code ?
def display(b,n): while n>0: print(b,end='') n=n-1display('z',3)
zzz
zz
An exception is thrown