WorksheetsPython Programming Basics Quiz
Total questions: 14
Worksheet time: 7mins
Who made Python?
Leonardo Da Vinci
Monty Python
Russell Crowe
Guido Van Russum
Why is Python called Python?
The inventor loved playing the snake game.
The inventor really enjoyed the ‘Monty Python’ series.
The inventor just liked snakes.
A python bit the inventor when he was making it.
What are the different types of data types in Python?
Integers
Floats
Strings
Booleans
All of the above
Which of the following is a mutable data structure?
Tuple
List
String
Set
What is Syntax?
A tax that programmers have to pay
The decided structure for each programming language
A tax that must be paid when you forget punctuation
The meaning of a word
What function is used to print output in Python?
print()
output()
show()
display()
Which of the following is NOT a valid data type in Python?
B. float
D. str
C. char
A. int
Fill in the blank space: An (a) is when a function lives within a class
What is the purpose of a for loop in Python?
To iterate over a sequence
To create a function
To define a variable
To handle exceptions
What is the purpose of a while loop in Python?
To repeat a block of code as long as a condition is true
To create a list
To define a function
To print output
How do you make a comment in Python?
Precede with ‘/*’ and end with ‘*/’
Use ‘//’ before each comment
Use ‘#’ before the comment
Write the comment backwards
What is the main purpose of OOP in programming?
To organize code into reusable and maintainable components
To make code less readable and harder to maintain
To limit the reusability of code components
To increase the complexity of the codebase
Functions do not work unless...
They are called
They are taken
They are removed
They are displayed
Fill in the blank: An (a) is a value passed to a function or method when is called
