List
Tuple
Dictionary
Set
Increases code duplication
Reduces code reusability
Promotes code reusability and modularity
Makes program slower
Lambda Function
Recursive Function
Anonymous Function
Built-in Function
What will be the output?
x = 10 def fun(): global x x = 20 fun() print(x)
10
20
Error
None
Local Variable
Static Variable
Global Variable
Instance Variable
Global Scope
Built-in Scope
Local Scope
Module Scope
infile.read(2)
infile.read()
infile.readlines()
infile.readline()
dump()
load()
Both A and B
None of the above
Append File
Write File
Read File
Read and Write both
pickle
binary
unpickle
fstream
write()
writeBinary()
read binary
write binary
append binary
read write
File Found Error
File Not Exist Error
File Not Found Error
None of these
a
ar+
r+
w
ab
rw
a+
readlines()
read()
Both of the above
What will be the output of the following code?
f=open("demo.txt","r") print(f.tell())
1
2
-1
0
os.rename(existing_name, new_name)
fq.name = ‘new_name.txt’
os.rename(fp, new_name)
os.set_name(existing_name, new_name)
write
output
send
dump
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