NEW
Font size
WorksheetsAssesment 1
Total questions: 25
Worksheet time: 13mins
What is the primary purpose of Python in real-world applications?
Data analysis
Web development
Game development
All of the above
Which of the following is a basic data type in Python?
Tuple
String
Dictionary
List
What does the 'if' statement do in Python?
Declares a variable
Executes a block of code based on a condition
Repeats a block of code
Defines a function
Which operator is used for comparison in Python?
||
&&
==
+
What is the output of the expression print((5+2)*5 + 3)?
54
38
56
15
How do you create a list in Python?
()
lst()
{}
[]
Which of the following is NOT a logical operator in Python?
not
or
xor
and
What is the purpose of a loop in programming?
To compare values
To define a variable
To execute a block of code multiple times
To create a function
Which of the following is a valid way to declare a variable in Python?
x := 10
10 = x
var x = 10
x = 10
What will be the output of the following code: print(2 * 3 + 1)?
7
6
8
5
Which of the following statements is used for decision-making in Python?
loop
if
for
while
What is the purpose of the 'elif' statement?
To declare a variable
To create a loop
To define a function
To handle multiple conditions
What is the output of the expression 'Hello+World'?
Hello+World
HelloWorld
Error
Hello World
What will be the output of the following code: print(10 > 5 and 5 < 3)?
None
Error
True
False
Which of the following is a valid list declaration?
my_list = [1, 2, 3]
my_list = {1, 2, 3}
my_list = (1, 2, 3)
my_list = 1, 2, 3
Which of the following is NOT a data type in Python?
String
Integer
Float
Character
What is the result of the expression 10 == 10?
True
False
None
Error
How do you define a list with mixed data types?
my_list = [1, 'two', 3.0]
my_list = (1, 'two', 3.0)
my_list = {1, 'two', 3.0}
my_list = 1, 'two', 3.0
What is the purpose of the 'pass' statement in Python?
To create a loop
To define a function
To skip a block of code
To exit a loop
What will be the output of the following code: print('A' in 'abcdefghAijklmno')?
Error
False
None
True
Who is the founder of Python programming language
Dennis Ritchie
James Arthur Gosling
Guido van Rossum
Bjarne Stroustrup
Which statement is true about elif?
elif can only be used once
elif is optional
elif ends the program
What will be printed?
Hi
Hello
Bye
Error
What is the output?
Greater
Equal
Smaller
Error
Which of these is the correct way to convert a string s to uppercase?
upper(s)
s.uppercase()
s.upper()
uppercase(s)
