WorksheetsPython Quiz - 5
Total questions: 10
Worksheet time: 5mins
What is the output of the following code?
list == [1,2,3]
print list
Syntax Error
List
[1,2,3]
None of the above
What is the output for the below code?
str = ['''hello''']
print(str)
str
hello
['''hello''']
['hello']
What is the type of data in the below code?
print(type(90+1j))
Float
String
Complex Numbers
None of the above
Which of the following enclose the input parameters or arguments of a function?
Curly braces
round braces
Square Braces
None of the above
Which of the following keywords marks the beginning of the function block?
Define
key
def
Fun
What is the output for the below code snippet?
def fun(message,num=3):
print(message*num)
fun('welcome')
Error
Welcome
welcomewelcomewelcome
None of the above
What is the output for the below code snippet?
def func():
num = 3
print(num)
func()
num
func
1
3
What is the output for the below code snippet?
def test(x = 1, y = 2):
x = x + y
print(x)
test()
3
4
Error
None of the above
What is the output for the below code snippet?
list = [1,5,3]
list.sort()
print(list)
[1,5,3]
List
sort
[1,3,5]
What does the min() function do?
Gives the minimum function
Gives the maximum function
Gives the minimum and the maximum function
None of the above
