f.seek(-10, 0)
f.seek(10,0)
f.seek(-10, 1)
None of the above
colon
comma
semicolon
hyphen
csv.reader(file)
csv.read(file)
csv.readcsv(file)
csv.readcsvdata(file)
int
null
None
An exception is thrown without the return statement
Variable
Literals
Identifiers
Comment
a
ar+
r+
w
Interface
Modularity
Client
Docstring
raise
goto
try
except
readall()
read()
readcharacter()
readchar()
What will be the output of the following Python code?
i = 2while True: if i%3 == 0: break print(i) i += 2
2 4 6 8 10 …
2 4
2 3
error
Interactive Mode
Script Mode
Both Interactive Mode or Script Mode
None of These
_py_
var
_var
It is used for object serialization
It is used for object deserialization
All of the mentioned
None of the mentioned
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
f = open("data.txt", "a")
f = Open("data.txt", "ab")
f= new("data.txt", "a")
open("data.txt", "a")
Use multiple write() statements.
Use writelines() method.
Use writeLine() method.
Use append() method.
True
False
Error
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.
33
45
35
30
execute python
go python
python
run python
End of List
End of Line
End of Loop
End of Language
C
C++
JAVA
PHP
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)
Curly Braces
Round Brackets
Indentation
Semicolon
ab
rw
a+
End of File
End of Statement
End of program
x = "abcdef"while i in x: print(i, end=" ")
a b c d e f
abcdef
i i i i i i …
Lists
Dictionary
Tuples
Class
Required arguments
Keyword arguments
Default arguments
Variable-length arguments
\n
\t
\\
All of the above
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
none of the mentioned
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.
1
10
0
f = open('data.txt'); f.read()
f = open('data.txt','r'); f.read(n)
myfile = open('data.txt'); f.readline()
f= open('data.txt'); f.readlines()
Brackets
Key
def foo(): total += 1 return totaltotal = 0print(foo())
File Found Error
File Not Exist Error
File Not Found Error
None of these
What will be the output of the following code?
f=open("demo.txt","r")print(f.tell())
2
-1
x = 'abcd'for i in range(len(x)): print(i)
1 2 3 4
factorial()
print()
seed()
sqrt()
student
s12
123
_123
What does the following code print ?
if 2 + 5 == 8: print("TRUE")else: print("FALSE")print("TRUE")
TRUE
TRUE FALSE
TRUE TRUE
FALSE TRUE
Python Interpreter.
Python compiler
Python Volatile machine
Portable virtual machine
Free and Open Source
Freeware
Open source
Shareware
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
8
Combination of Interactive and Script modes
All of these
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
Platform-independent
Low Level Language
Python is open-source and free to use
Object Oriented Programming
val
with