Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Computer Programming Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What does syntax refer to in programming languages?

a)

Set of rules that guide how statements and phrases are constructed

b)

Special words reserved for specific purposes

c)

Blocks used for stacking in visual programming languages

d)

Predefined functions for specific tasks

2.

How are statements terminated in Python and most text-based programming languages?

a)

Colon

b)

Semi-colon

c)

Comma

d)

Full stop

3.

What are the two main types of errors in programming?

a)

Syntax errors and Logical errors

b)

Runtime errors and Logical errors

c)

Syntax errors and Runtime errors

d)

Syntax errors and Semantic errors

4.

Identifiers in Python are names of entities and must follow certain rules. Which of the following is NOT a rule for identifiers?

a)

Case-sensitive

b)

Can contain spaces and special characters

c)

Must start with a letter or underscore

d)

Must not be a keyword

5.

What is the purpose of keywords in Python?

a)

To create identifiers

b)

To print messages on the screen

c)

To serve as special words with specific purposes

d)

To define user-defined functions

6.

If a function in Python contains more than one argument, how are the arguments separated?

a)

Comma

b)

Semi-colon

c)

Full stop

d)

Colon

7.

Which type of errors deal with wrong output or abnormal behaviors of programs?

a)

Logical errors

b)

Syntax errors

c)

Semantic errors

d)

Runtime errors

8.

What is the purpose of a function in programming?

a)

To create identifiers

b)

To perform a specific task

c)

To define keywords

d)

To terminate statements

9.

What is the order in which a computer solves a problem?

a)

Process, Input, Output

b)

Output, Process, Input

c)

Process, Output, Input

d)

Input, Process, Output

10.

What is the equivalent of a say block in Scratch when using Python?

a)

print()

b)

def

c)

int()

d)

input()

11.

Which of the following is NOT a valid identifier in Python?

a)

abel

b)

road Y

c)

#size

d)

else

12.

What is the purpose of the print() function in Python?

a)

To get user input

b)

To define a keyword

c)

To print messages on the screen

d)

To create identifiers

13.

What is the correct syntax for using functions in Python?

a)

name<>

b)

name[]

c)

name()

d)

name{}

14.

What is the purpose of writing an algorithm before writing a program?

a)

To process the inputs

b)

To solve the problem step by step

c)

To identify all the inputs needed

d)

To identify the desired output

15.

What is the purpose of the interactive mode in Python IDLE?

a)

To save programs

b)

To write programs

c)

To test and execute Python commands

d)

To open text editors