wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CodeAcademy Python Test

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

What programming language is popular in 2024?

a)

Python

b)

Scratch

c)

C++

d)

C#

e)

HTML

2.

C++ is a...

(a)  

3.

How can we talk in Python?

a)

print ("Hello")

b)

printf("Hello)

c)

print("Hello")

d)

print <fuction> sp"

4.

What is the output of the following Python code?

x = 5
y = 3
print(x + y)

a)

8

b)

15

c)

53

d)

2

5.

Which data type is used to store a single character in Python?

a)

int

b)

char

c)

string

d)

float

6.

What is the correct way to comment a single line in Python?

a)

// This is a comment

b)

/* This is a comment */

c)

# This is a comment

d)

%% This is a comment

7.

What is the correct way to define a function in Python?

a)

def my_function():

b)

function my_function():

c)

define my_function():

d)

function = my_function():

8.

How can we check the length of a list in Python?

a)

len(list_name)

b)

length(list_name)

c)

size(list_name)

d)

count(list_name)

9.

Which statement is used for conditional execution in Python?

a)

for

b)

if

c)

while

d)

switch

10.

Which loop is used for iterating over a sequence in Python?

a)

for

b)

if

c)

while

d)

switch