wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SdjdUIKNHJN@!SDJ(Python)

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Which of the following is NOT one of the six basic computer operations?

a)

Receive information (input)

b)

Perform arithmetic

c)

Store data permanently

d)

Compare two pieces of information

2.

What is the purpose of pseudocode?

a)

To write executable Python code

b)

To represent logical steps in an English-like manner

c)

To draw flowcharts

d)

To debug programs

3.

In a flowchart, what shape represents a process or calculation?

a)

Parallelogram

b)

Diamond

c)

Rectangle

d)

Oval

4.

Which pseudocode keyword is used to mark the beginning of an algorithm?

a)

BEGIN

b)

START

c)

GO

d)

RUN

5.

What is the final step in developing a program after testing?

a)

Write pseudocode

b)

Document and maintain

c)

Compile the code

d)

Draw a flowchart

6.

Which control structure is used when a decision must be made between two paths?

a)

Sequence

b)

Selection

c)

Repetition

d)

Iteration

7.

In pseudocode, how is an IF-ELSE statement written?

a)

if condition then statement else statement endif

b)

if condition: statement else: statement

c)

while condition do statement

d)

for condition loop statement

8.

What type of loop checks the condition before executing the loop body?

a)

Post-test loop

b)

Pre-test loop

c)

Infinite loop

d)

Sentinel loop

9.

In a counter-controlled loop, what three things must be managed?

a)

Input, output, process

b)

Start, stop, pause

c)

Initialization, testing, updating

d)

Variable, constant, operator

10.

What is a "sentinel value" used for?

a)

To count loop iterations

b)

To signal the end of input in a loop

c)

To start a loop

d)

To perform arithmetic

11.

Which of the following is a valid Python comment?

a)

// This is a comment

b)

# This is a comment

c)
d)

/* This is a comment */

12.

What is the output of print(‘hello’ + ‘there’) in Python?

a)

hello there

b)

hellothere

c)

hello+there

d)

Error

13.

Which Python function is used to receive user input?

a)

scan()

b)

input()

c)

read()

d)

get()

14.

What is the purpose of the int() function in this line? age = int(input("How old are you? "))

a)

To print an integer

b)

To convert input to an integer

c)

To create a loop

d)

To check if input is valid

15.

Which mode of Python execution allows you to type commands directly and see immediate results?

a)

Script mode

b)

Interactive mode

c)

Compiled mode

d)

Debug mode

16.

In a flowchart, what shape is used for a decision?

a)

Rectangle

b)

Parallelogram

c)

Diamond

d)

Circle

17.

If Num = 10 in a flowchart that checks if Num > 5 and prints “Big”, what is the output?

a)

“Small”

b)

“Big”

c)

No output

d)

Error

18.

What does this pseudocode do? text Start sum = 0 count = 1 while count <= 5 sum = sum + count count = count + 1 End while Print sum End

a)

Prints numbers 1 to 5

b)

Prints the sum of 1 to 5

c)

Prints “sum”

d)

Runs an infinite loop

19.

In the pizza dough recipe example from the slides, what programming concept does “If dough comes off the sides go to step 6, otherwise go back to step 4” represent?

a)

Sequence

b)

Selection

c)

Repetition

d)

Input

20.

Which of the following is a valid Python variable name?

a)

1st_var

b)

my-var

c)

_var1

d)

var name