NEW
Font size
WorksheetsPYTHON UNIT I MCQS
Total questions: 15
Worksheet time: 8mins
Which of the following is a feature of Python?
Strongly typed language
Static typing
Interpreted language
Compiler-based language
Which of the following is a valid identifier in Python?
1variable
variable_1
global
break
Which of the following is a reserved keyword in Python?
for
while
if
all of the above
How do you define a variable in Python?
var x = 5
x = 5
int x = 5
variable x = 5
What is the purpose of comments in Python?
They are used to improve the performance of the code.
They are used to make the code run faster.
They are used to explain the code and make it more readable.
They are used to add extra functionality to the code.
Which symbol is used for indentation in Python?
Spaces
Tabs
Both spaces and tabs
None of the above
How do you write a multi-line statement in Python?
Separate each line with a comma (,)
Use the backslash (\) at the end of each line
Enclose the statement in triple quotes (""")
Use a semicolon (;) at the end of each line
What is a suite in Python?
A group of multiple statements within a loop or a function
A Python module containing multiple functions
A group of reserved keywords in Python
A data type for storing multiple values
Which type of quotes can be used to define a string in Python?
Single quotes ('')
Double quotes ("")
Both single and double quotes
None of the above
How do you take user input in Python?
input()
get_input()
user_input()
read()
Which function is used to print output in Python?
print()
output()
display()
show()
Which operator is used for exponentiation in Python?
^
*
%
**
Which data type is used to store a sequence of characters in Python?
Integer
Float
String
Boolean
How do you convert a string to an integer in Python?
str()
int()
float()
bool()
