WorksheetsPython Intro
Total questions: 15
Worksheet time: 3mins
What would this print?
Print("Hello world!")
print(9/3)
10//3
3
3.3
0.3
3.0
We start the definition of the function with?
func
def
int
non of the above
In the first line, a and b are called ____
parameters
arguments
values
both parameters and arguments
The output from the previous code is ____
true!
false!
printing( false! ) forever
none of the above
What is the output of program below?
motorcycles = ['honda', 'yamaha', 'suzuki']
motorcycles.sort()
print(motorcycles)
['honda', 'yamaha', 'suzuki']
['yamaha', 'suzuki', 'honda']
['honda', 'suzuki', 'yamaha']
['suzuki', 'yamaha', 'honda']
What is the index of “grape” in the list
[“apple”, “grape”, “orange”, “watermelon”]?
0
1
2
3
Is this the correct code for a list?
register = {"Sam", "Pheobe", Georgia", Richard"}
Yes
No
What is the process of converting one datatype to another called?
Data conversion.
Type Casting.
Type Conversion.
Concatenation.
What function converts the data in a variable into a 'float'?
int()
flt()
bool()
float()
__________ is the built-in function to know the type of a variable or function.
id()
type()
data_type()
none of the above
Identify the first statement that creates a class named Employee.
class Employee():
Class Employee:
class employee:
class Employee:
What does __init__ do?
Constructs the instance
Initialize the instance values
Calls the Super class
Creates a circle
