WorksheetsPython Basics
Total questions: 10
Worksheet time: 3mins
Which of the following statements is true?
Python is a high level programming language.
Python is an interpreted language.
Python is an object-oriented language.
All of the above.
What is used to define a block of code (body of loop, fuction etc.) in Python?
Curly braces
Parenthesis
Indentation
Quotation
Which of the following is correct?
Comments are for programmers for better understanding of the program.
Python Interpreter ignores comment.
You can write multi-line comments in Python using triple quotes, either ''' or """.
All of the above
Which of the following is correct?
Variable name can start with an underscore.
Variable name can start with a digit.
Keywords cannot be used as a variable name.
Variable name can have symbols like: @, #, $ etc.
In the following code, n is a/an _______?
n = '5'
integer
string
tuple
operator
What is the output of the following code?
print(1, 2, 3, 4, sep='*')
1 2 3 4
1234
1*2*3*4
24
What is used to take input from the user in Python?
cin
scanf()
input()
<>
What is the output of the following code?
numbers = [2, 3, 4]
print(numbers)
2, 3, 4
2 3 4
[2, 3, 4]
[2 3 4]
What is the output of the following code?
print(3 >= 3)
3 >= 3
True
False
None
The statement using and operator results true if _______
both operands are true
both operands are false
either of the operands is true
first operand is true
