WorksheetsExploring Python Fundamentals
Total questions: 9
Worksheet time: 2mins
What is the output of the following code: print(type(5))?
int
char
float
error
Which of the following is not a built-in data type in Python?
list
tuple
array
dictionary
What will be the output of the following code: x = 10; while x > 0: x -= 1; print(x)?
10
1
0
-1
How do you create a string in Python?
You can create a string in Python using single quotes, double quotes, or triple quotes.
You must use a specific library to create strings.
You can create a string using only numbers.
Strings can only be created with special characters.
What is the result of the expression 'Hello' + ' World'?
HelloWorld
Hello World
Hello, World!
Hello World!
Which data type is used to store a sequence of characters?
boolean
integer
float
string
What will be the output of print('Python'[::-1])?
nohtyP
nohtyP!
Python
Pyhton
What is the output of len('Hello, World!')?
12
13
14
15
What is the purpose of the 'break' statement in a while loop?
The 'break' statement continues to the next loop without exiting.
The 'break' statement skips the current iteration of the loop.
The 'break' statement is used to exit a while loop.
The 'break' statement pauses the while loop.
