Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Basics

Total questions: 10

Worksheet time: 3mins

Name
Class
Date
1.

Which of the following statements is true?

a)

Python is a high level programming language.

b)

Python is an interpreted language.

c)

Python is an object-oriented language.

d)

All of the above.

2.

What is used to define a block of code (body of loop, fuction etc.) in Python?

a)

Curly braces

b)

Parenthesis

c)

Indentation

d)

Quotation

3.

Which of the following is correct?

a)

Comments are for programmers for better understanding of the program.

b)

Python Interpreter ignores comment.

c)

You can write multi-line comments in Python using triple quotes, either ''' or """.

d)

All of the above

4.

Which of the following is correct?

a)

Variable name can start with an underscore.

b)

Variable name can start with a digit.

c)

Keywords cannot be used as a variable name.

d)

Variable name can have symbols like: @, #, $ etc.

5.

In the following code, n is a/an _______?


n = '5'

a)

integer

b)

string

c)

tuple

d)

operator

6.

What is the output of the following code?


print(1, 2, 3, 4, sep='*')

a)

1 2 3 4

b)

1234

c)

1*2*3*4

d)

24

7.

What is used to take input from the user in Python?

a)

cin

b)

scanf()

c)

input()

d)

<>

8.

What is the output of the following code?


numbers = [2, 3, 4]

print(numbers)

a)

2, 3, 4

b)

2 3 4

c)

[2, 3, 4]

d)

[2 3 4]

9.

What is the output of the following code?


print(3 >= 3)

a)

3 >= 3

b)

True

c)

False

d)

None

10.

The statement using and operator results true if _______

a)

both operands are true

b)

both operands are false

c)

either of the operands is true

d)

first operand is true