wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Basics Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Which of the following is an integer in Python?

a)

10.5

b)

10

c)

"10"

d)

True

2.

Which of the following is a Boolean value in Python?

a)

Yes

b)

True

c)

1.0

d)

"True"

3.

Which function is used to display output on the screen?

a)

display()

b)

echo()

c)

print()

d)

output()

4.

Which function is used to take input from the user?

a)

read()

b)

input()

c)

scan()

d)

enter()

5.

What will be the result of 5 + 3 in Python?

a)

53

b)

8

c)

"5+3"

d)

2

6.

What will True and False evaluate to in Python?

a)

True

b)

False

c)

1

d)

0

7.

Which of the following is a string in Python?

a)

"Hello"

b)

Hello

c)

100

d)

10.5

8.

What will "Python" + "Code" output?

a)

Python Code

b)

PythonCode

c)

"Python+Code"

d)

Error

9.

Which operator is used for multiplication in Python?

a)

x

b)

*

c)

X

d)

×

10.

What will be the result of "Hi" * 3 in Python?

a)

HiHiHi

b)

9

c)

"Hi3"

d)

Error

11.

What does " hello ".strip() return?

a)

"hello"

b)

" hello "

c)

" hello"

d)

"hello "

12.

What does " hello ".lstrip() return?

a)

"hello"

b)

"hello "

c)

" hello"

d)

" hello "

13.

What does " hello ".rstrip() return?

a)

"hello"

b)

" hello"

c)

"hello "

d)

" hello "

14.

What does len("Python") return?

a)

5

b)

6

c)

"6"

d)

Error

15.

What does "Python".startswith("Py") return?

a)

False

b)

True

c)

"True"

d)

Error