Font size
WorksheetsAdvanced Python Quiz1
Total questions: 10
Worksheet time: 11mins
To access mathematical functions in python, we need this line in our code.
import math functions
import math
from python import math
from py import mathematics
What is the output of the given function call?
9
num=9
print 9
return 9
Which of the following prints all letters in alpha? (More than one answer)
What Python command takes the answer from the user and assigns it to ur_name variable.
ur_name = val("Please enter your name")
ur_name = input("Please enter your name")
ur_name = print("Please enter your name")
ur_name = answer("Please enter your name")
What is the output of the given code?
['cat','dog','elephant','tiger']
['cat','dog','elephant']
['dog','elephant','tiger']
['dog','elephant','tiger','fox']
What is the output of the given code?
The car is awesome. The car wins the race
The car wins the race
The car is awesome
ERROR
Given this class, how would you make McQueen win the race?
McQueen.win()
McQueen(win)
win.McQueen()
win(McQueen)
What is the output of the given code?
This race car is awesome
The car wins the race
The car is awesome
The car is awesome. The car wins the race
What is the code to get a random value between 100 and 125?
random(100,125)
random.randint(100,125)
random(125)
random(randint)[100,125]
Which of the following is true? (More than one answer)
Stack uses FIFO (First In First Out) method
Queue uses FIFO (First In First Out) method
Stack uses LIFO (Last In First Out) method
Queue uses LIFO (Last In First Out) method
