What will be the output of following?
Y=[2,5J,6] Y.sort()
[2,6,5J]
[5J,2,6]
Error
[6,5J,2]
break
pass
continue
none of these
What is the output of the following code?
def s(n1): print(n1) n1=n1+2 n2=4 s(n2) print(n2)
6 4
4 6
4 4
6 6
What is the output of the following?
x=123 for i in x: print(i)
1 2 3
123
Subtracting two numbers
Comparing two data values
Providing output to the user
Adding two numbers
What will be the output of the following Python code ?
def display(b,n): while n>0: print(b,end='') n=n-1 display('z',3)
zzz
zz
Infinite loop
An exception is thrown
A static variable
A global variable
A local variable
An automatic variable
A function that calls itself
A function that calls other functions
Both (A) and (B)
None of the above
procedure
function
bug
None of these
Lists
Dictionary
String
All of the mentioned
In Module
In Class
In Another function
All of these
A built-in Python function
A one-line anonymous function
Lambda is a function in python but user can not use it.
;
: :
:
%
None
0
Null
Arbitary value
def fun (a = 2, b = 3, c)
def fun(a = 2, b, c = 3)
def fun(a, b = 2, c = 3)
def fun(a, b, c = 3, d)
function_name()
call function_name()
ret function_name()
function function_name()
Required arguments
Keyword arguments
Default arguments
Variable-length arguments
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.
int
null
An exception is thrown without the return statement
A function that calls other function.
A function which calls itself.
Both A and B