What will be the output of the following Python code?
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
.py
.python
.p
None of these
32
64
35
29
Comments
Expressions
Tokens
Flow of control
31 characters
63 characters
No limit but 79 characters for better redability
All of the above.
Number
String
List
Slice
Free and Open Source
Freeware
Open source
Shareware
100
128
256
No Limit
re\new
new
re new
re ew
What will the following code output?
a=‘INFOMAX’ a=10 print(type(a))
<class 'int'>
<class ‘str'>
<class ‘bool'>
Error
a_=3
_a=3
a?=3
All of these
What is the output of the following code?
a=set('abc')b=set('cdef')print(a&b)
{'c'}
{'a','b','c','d','e','r'}
{c}
Built in datatype
Derived datatype
Concrete datatype
Abstract datatype
None
True
False
equal
Hello
949227
"2'
Flexibility
Portability
Reliability
Interactive Mode
Script Mode
Both Interactive Mode or Script Mode
None of These
yes
no
machine dependent
none of the mentioned
.pyt
Variable
Literals
Identifiers
Comment
33
45
30
Python Interpreter.
Python compiler
Python Volatile machine
Portable virtual machine
raise
try
val
with
Keywords
Identifires
Token
Statement
Combination of Interactive and Script modes
pi
anonymous
lambda
none of the above
C
C++
JAVA
PHP
Brackets
Indentation
Key
None of the above
email
ca$h
marks10
Python2Shar
_py_
var
_var
Interpreter
Compiler
Combination of Compiler and Interpreter
all of these
.
#
/
?
int
bool
void
execute python
go python
python
run python
get()
seek()
tell()
cur()
Expression
in
is
assert
All
English
All of the above
31
Lists
Dictionary
Tuples
Class
What will be the datatype of the var in the below code snippet?
var = 10print(type(var))var = "Hello"print(type(var))
Str and int
int and int
str and str
int and str
\a
\t
\n
\b
float
dict
Passing –O when running python
Assertions are disabled by default
Both A and B are wrong
Assertions cannot be disabled in python
//
!
Docstring
Python Package Index
both a & b
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.
High Level
Object Oriented
Low Level
Both A and B
list
tuple
class
dictionary