round(45.8)
round(6352.898,2,5)
round()
round(7463.123,2,1)
5 characters
5 words
5 lines
None of the above
raise
goto
try
except
What is the value of the following Python code?
>>>print(36 / 4)
9
4
9.0
4.0
file_object=open(file_name,mode)
open(file_object,file_name,mode)
file_open(file_object,file_name,mode)
file_object=file_open(file_name,mode)
What is the output of the following code?
count=0while count<3: print(count,end=" ") count+=1
0 1 2
1 2 3
0 1 2 3
Error
ab
rw
a+
r+
os.rename(existing_name, new_name)
fq.name = ‘new_name.txt’
os.rename(fp, new_name)
os.set_name(existing_name, new_name)
readall()
read()
readcharacter()
readchar()
Interpreter
Compiler
Combination of Compiler and Interpreter
all of these
~
|
&
^
What is the return type of following function ?
def func1(): return 'mnp',22print(type(func1()))
List
Dictionary
String
Tuple
softspace
mode
closed
rename
f.seek(-10, 0)
f.seek(10,0)
f.seek(-10, 1)
sets the file's current position at the offset
sets the file's previous position at the offset
sets the file's current position within the file
None of these
32
33
31
30
End of List
End of Line
End of Loop
End of Language
Variable
Literals
Identifiers
Comment
Quick response code
Same format in which the data is held in memory
ASCII format
Unicode format
File Found Error
File Not Exist Error
File Not Found Error
Expression
Portability
Reliability
What will be the output of the following expression ?
x =4print(x<<2)
16
6
2
What will be the output of the following Python code?
x = 'abcd'for i in range(len(x)): print(i)
a b c d
error
1 2 3 4
a=set('abc')b=set('cdef')print(a&b)
{'c'}
{'a','b','c','d','e','r'}
{c}
64
35
29
Tells you the current position within the file.
Tells the size of file you read
Tells the start position of the file.
Tells the end position of the file.
Class
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 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
x = 'abcd'for i in range(len(x)): print(i.upper())
5
1
10
0
Comma Space Value
Comma Separated Value
Common spaced Value
Compact Structure View
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
Infinite loop
An exception is thrown
list
tuple
class
dictionary
\n
\t
\\
All of the above
f.reads()
f.read()
f.read(all)
f.read( *)
val
with
8
read binary
write binary
append binary
read write
write()
append()
add()
insert()
float
str
set
int
What value does the following expression evaluate to ?
x = 5while x < 10: print(x, end='')
Closed loop
one time loop
Evergreen loop
eval
nonlocal
assert
finally
It is used for object serialization
It is used for object deserialization
All of the mentioned
None of the mentioned
What will be the output?
f = open("test.txt", "w")f.write("Python")f.seek(0)print(f.read())
Python
Empty String
UnsupportedOperation Error
None
What will be written to the file?
f = open("test.txt", "w")f.write("ABC")f.write("DEF")f.close()
ABC
DEF
ABCDEF
Brackets
Quotes
Braces
Parentheses
Integer
Complex Number
open_file()
file_open()
open()
read_file()