WorksheetsComputer Programming Quiz
Total questions: 15
Worksheet time: 8mins
What does syntax refer to in programming languages?
Set of rules that guide how statements and phrases are constructed
Special words reserved for specific purposes
Blocks used for stacking in visual programming languages
Predefined functions for specific tasks
How are statements terminated in Python and most text-based programming languages?
Colon
Semi-colon
Comma
Full stop
What are the two main types of errors in programming?
Syntax errors and Logical errors
Runtime errors and Logical errors
Syntax errors and Runtime errors
Syntax errors and Semantic errors
Identifiers in Python are names of entities and must follow certain rules. Which of the following is NOT a rule for identifiers?
Case-sensitive
Can contain spaces and special characters
Must start with a letter or underscore
Must not be a keyword
What is the purpose of keywords in Python?
To create identifiers
To print messages on the screen
To serve as special words with specific purposes
To define user-defined functions
If a function in Python contains more than one argument, how are the arguments separated?
Comma
Semi-colon
Full stop
Colon
Which type of errors deal with wrong output or abnormal behaviors of programs?
Logical errors
Syntax errors
Semantic errors
Runtime errors
What is the purpose of a function in programming?
To create identifiers
To perform a specific task
To define keywords
To terminate statements
What is the order in which a computer solves a problem?
Process, Input, Output
Output, Process, Input
Process, Output, Input
Input, Process, Output
What is the equivalent of a say block in Scratch when using Python?
print()
def
int()
input()
Which of the following is NOT a valid identifier in Python?
abel
road Y
#size
else
What is the purpose of the print() function in Python?
To get user input
To define a keyword
To print messages on the screen
To create identifiers
What is the correct syntax for using functions in Python?
name<>
name[]
name()
name{}
What is the purpose of writing an algorithm before writing a program?
To process the inputs
To solve the problem step by step
To identify all the inputs needed
To identify the desired output
What is the purpose of the interactive mode in Python IDLE?
To save programs
To write programs
To test and execute Python commands
To open text editors
