NEW
Font size
WorksheetsSdjdUIKNHJN@!SDJ(Python)
Total questions: 20
Worksheet time: 10mins
Which of the following is NOT one of the six basic computer operations?
Receive information (input)
Perform arithmetic
Store data permanently
Compare two pieces of information
What is the purpose of pseudocode?
To write executable Python code
To represent logical steps in an English-like manner
To draw flowcharts
To debug programs
In a flowchart, what shape represents a process or calculation?
Parallelogram
Diamond
Rectangle
Oval
Which pseudocode keyword is used to mark the beginning of an algorithm?
BEGIN
START
GO
RUN
What is the final step in developing a program after testing?
Write pseudocode
Document and maintain
Compile the code
Draw a flowchart
Which control structure is used when a decision must be made between two paths?
Sequence
Selection
Repetition
Iteration
In pseudocode, how is an IF-ELSE statement written?
if condition then statement else statement endif
if condition: statement else: statement
while condition do statement
for condition loop statement
What type of loop checks the condition before executing the loop body?
Post-test loop
Pre-test loop
Infinite loop
Sentinel loop
In a counter-controlled loop, what three things must be managed?
Input, output, process
Start, stop, pause
Initialization, testing, updating
Variable, constant, operator
What is a "sentinel value" used for?
To count loop iterations
To signal the end of input in a loop
To start a loop
To perform arithmetic
Which of the following is a valid Python comment?
// This is a comment
# This is a comment
/* This is a comment */
What is the output of print(‘hello’ + ‘there’) in Python?
hello there
hellothere
hello+there
Error
Which Python function is used to receive user input?
scan()
input()
read()
get()
What is the purpose of the int() function in this line? age = int(input("How old are you? "))
To print an integer
To convert input to an integer
To create a loop
To check if input is valid
Which mode of Python execution allows you to type commands directly and see immediate results?
Script mode
Interactive mode
Compiled mode
Debug mode
In a flowchart, what shape is used for a decision?
Rectangle
Parallelogram
Diamond
Circle
If Num = 10 in a flowchart that checks if Num > 5 and prints “Big”, what is the output?
“Small”
“Big”
No output
Error
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
Prints numbers 1 to 5
Prints the sum of 1 to 5
Prints “sum”
Runs an infinite loop
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?
Sequence
Selection
Repetition
Input
Which of the following is a valid Python variable name?
1st_var
my-var
_var1
var name
