WorksheetsGrade 10 ICT Assessment Term 1 – November 2024
Total questions: 90
Worksheet time: 50mins
What is a program?
A set of instructions that tell a computer what to do.
A piece of hardware.
A type of computer virus.
A social media platform.
What is one of the main tasks of a programmer?
Write and post blogs
Debug code to find and fix errors
Create digital artwork
Design hardware components
What does an algorithm describe?
The graphics of a program
The steps in a program
The user interface design
The network configuration
What is the first step a programmer takes before writing code?
Test the program
Write an algorithm
Debug the program
Compile the code
Which of the following is NOT a duty of a programmer?
Which command is used to show words on the screen in Python?
display
echo
show
What is the output of the following Python command: print('hi')?
hi
'hi'
print('hi')
None
Which of the following is an integer calculation you can try in Python?
6+2
"hello "+" world"
'4'+'5'
None of the above
What will the following Python commands output? answer = 3+3 print(answer)
A) 33
B) 6
C) answer
D) 3+3
Which command is used to stop an infinite loop in Python running in the shell?
(a)
Which symbol is used in Python to check if two values are equal?
A) >
B) <
C) ==
D) !=
What is the purpose of using comments in Python?
To execute commands
To store variables
To provide explanations or notes about the code
To display output to the player
What command is used to ask the player to input a path number in Python?
print()
input()
while()
random.randint()
What does the input function do in the Python Hunt game?
Displays text on the screen
Stores a random number
Takes input from the player
Ends the game loop
What should you do first to start debugging in Python?
(a)
In the Catch the Bugs game, what library is imported to use the random number functions?
Math
Random
Datetime
OS
Which of the following actions will cause a syntax error in the Python code?
Adding a comment line with #
Deleting a necessary equal sign (=)
Using variables
Running the code without saving
What happens if you misspell a function name, like changing print to prin()?
The code runs but ignores the line
The code runs but with a warning
The code throws an error
The code automatically corrects the mistake
How can you identify a comment in Python code?
It starts with //
It starts with #
It starts with --
It is enclosed in quotes
What does the following code output? x = 5 if x > 10: print("Greater") else: print("Smaller")
Greater
Smaller
Error
None
Which of the following correctly defines a string in Python?
print('a string is text')
print(it's a string)
print('let's learn")
print("he said, "wow"")
Which variable assignment is correct in Python?
name$('value')
name='Student Name'
name !=('student_name')
name==('Student Name')
Which variable names follow Python's naming conventions?
!color=('red')
2color=('red')
_color=('red')
None of the above
What is the output of the following program? name = ('Student Name') print (name)
A) name
B) It will show an error.
C) Student Name
D) None of the above
Which of the following is not the rule of naming variable?
A variable name must be one word with no spaces.
A variable name cannot be a Python keyword.
A variable name can start with special characters like & and $.
All of the above are the rules of naming Python variables.
What is the purpose of the (print) function in the Pet Monster Rescue program?
To create a variable
To show text on the screen
To ask a question
To store a value
Which code snippet would you use to create a variable named place with the value 'Pet Monster Rescue'?
place = 'Pet Monster Rescue'
place.input('Pet Monster Rescue')
place('Pet Monster Rescue')
place.print('Pet Monster Rescue')
How do you include a variable value in the middle of a sentence?
print('Welcome to', place)
print('Welcome to ' place)
Which code snippet correctly asks the user for their name and stores it in a variable?
name = input('What is your name?')
input('What is your name?') = name
name = print('What is your name?')
print('What is your name?') = name
What is an algorithm in programming?
A. A type of programming language
B. A keyword used to trigger actions
C. A description of what the program will do
D. A method for organizing variables
Which keyword is used to trigger an action when a statement is true in Python?
else
then
if
for
What does the '==' operator do in Python?
Assigns a value to a variable
Checks if two values are equal
Checks if two values are different
Compares two values to see which is greater
Which of the following is a logical operator used to check if two values are different in Python.
==
!=
What is the purpose of a flowchart in programming?
To write the actual code of the program
To describe the visual appearance of the program
To outline the logical flow of an algorithm
To list the variables used in the program
What variable is used to start and stop the search for a pet in the Pet Monster Rescue program?
search
pet
find
match
Which Python keyword is used to create a loop that contains a list of questions?
if
else
while
for
What does the != operator check for in Python?
Equality
Greater than
Less than
Inequality
How can you stop a loop when a match is found in the Pet Monster Rescue program?
Using continues
Setting finds to False
Using break
Both B and C
What type of value must be converted to an integer for the logic to work in the question about the number of eyes?
horns
body
eyes
arms
How can you stop an infinite loop in the Python Shell?
Press ALT + F4
Press CTRL + C
Press ESC
Press SHIFT + S
Which library is used to add a delay between loop iterations in Python?
datetime
random
time
sys
How can you make the loop ask the player if they want to keep counting after every five numbers?
Use a nested loop.
Use a variable to count iterations and reset it.
Use a function call.
Use a break statement inside the loop.
One of the most valued traits of a programmer is their curiosity. What does this mean?
A programmer asks questions.
A programmer tries new things and welcomes surprises.
A programmer takes risks.
All of the above
A programmer keeps an open mind. This means that
They may ask someone for help or research to learn more.
They consider new ideas and are not quick to judge.
They are not afraid to make mistakes.
All of these
Text such as a word, phrase, or sentence are called.
Variables
Strings
Comments
Integers
Note to a programmer about the code.
Variables
Strings
Integers
Comments
A stored value that can change.
Variable
String
Integer
Comment
print(I can program) Find out missing punctuation.
"
Her
'
=
Pick the correct code to display the output 10 on screen.
print('5+5')
print(5+5)
print("6+4")
all of these
Pick the correct code to display the output (Hello Beth)
name=('Beth') print('Hello', name)
name=('Beth') print('Hello name')
name=('Beth') print('Hello'+name)
Identify correct python command to complete the line of code. name=________('What is your name?')
While
If
Input
Identify correct python command to complete the line of code. __________ ('I like to code.')
While
If
Input
Identify correct python command to complete the line of code. ________True:
While
If
Input
Identify correct python command to complete the line of code. ________answer=='yes':
While
If
Input
If the score is greater than 4, end the game. Choose the correct logical operator from given options.
<
<=
==
>
if score _____ 4: print('game over') break
==
!=
<
>
Complete the code to ask the person if they want to answer the questions again. print('We do not have a matching pet.') answer= ______ ('Do you want to answer the questions again? ')
Input
If
==
Complete the code to make decision in a program. print('We do not have a matching pet.') answer= print('Do you want to answer the questions again? ') if answer _____ '0':
Else
==
Input
A Python command that stops a loop.
Exit
Close
Break
library
A collection of Python commands used to do actions.
Exit
Close
Break
library
A loop that runs forever until a condition is met.
While
For
Library
Close
A loop that runs a specific number of times.
While
For
Library
Close
What does the Python code do? random.randint(1, 25)
stop a loop from running
loop a set of instructions 25 times
pick a number between 1 and 25
none of these
What does the Python code do?
fetch commands from a Python library
select a number from a range
pick from a list of choices
What does the Python code do?
change the answer from an integer into a string
change the answer from a string into an integer
print the number of students in the class
none of these
What will be the output of given code? for repeat in range(4): print('I can program.')
Print I can program Print I can program
Print I can program
Print I can program Print I can program Print I can program Print I can program
None of these
Which variable shows the initial score of the game?
score=0
score=score+0
score=score+1
score=1
Which line of code increases the score by one point:
score=0
score=score+1
print('You correctly guessed', score, 'times.')
A person who writes a program is called?
Tester
Debugger
Programmer
End user
A number is also called a/an?
Variable
Integer
String
Function
To find and fix the mistakes in the code is called?
Designing
Testing
Ideate
Debugging
A set of instructions that repeat are part of
Defined functions
Inbuilt functions
Loops
Data types
The purpose of using the command below is to:
The purpose of the code below is
To Assign the value ‘pet monster rescue’ to the place variable
Place and ‘pet monster rescue’ are equal.
The characters in place and ‘pet monster rescue’ are equal.
Place and ‘pet monster rescue’ are equal.
Which of the following function is used to take input from user?
Raw()
Raw_input()
Input_raw()
Input()
The mistake that we find while testing a program are called.
Viruses
Bugs
Worms
Trojan
Which of the following trait is not required in a programmer?
Analytical Reasoning
Logical Thinking
Creativity
None of the above
A programmer divides the program into chunks to?
It makes the program more maintainable and testable.
It reduces the compilation time.
To produce smaller and more focused files.
All of the above
Who is programmer _____?
(The answer is not provided in the image, so this is an open-ended question.)
Bill Gates
Ada Lovelace
Linus Torvalds
Makes a program.
Makes a program.
Test and Debug a program.
Develops the design and structure of software.
Manages the development of software.
It is important to sequence the steps in a program accordingly because otherwise.
It will not work properly.
The computer won’t be able to follow the instruction.
It will work properly.
Option A and B
The proper way of grouping the instruction in python is:
Indent the blocks.
Put them in same line.
None of the above
Option A and option B
The line of code which is used to tell the program to get commands from random library is.
Import time.
Import random.
Import speed.
Import rand.
This line of code will
Picks an option from wrong list of choices.
Picks an option from right list of choices.
Lists responses to a correct guess.
Both B and C
What will be the output of the line of code.
It will print great guess.
It will show an error.
It will assign great guess to a right variable.
What does the given code shows if num_pick>number: print('Your guess is too high.') print (random.choice(wrong))
If the number picked by user is greater than number, then it will print “your guess is too high” and print an option from wrong list of choices.
If the number picked by user is greater than number, then it will print “your guess is too high” and print an option from right list of choices.
If the number picked by user is less than number, then it will print “your guess is too high” and print an option from wrong list of choices.
If the number picked by user is less than number, then it will print “your guess is too high” and print an option from right list of choices.
What does the given code in image shows?
If the number picked by user is greater than number, then it will print “your guess is too high” and print an option from wrong list of choices.
If the number picked by user is greater than number, then it will print “your guess is too high” and print an option from right list of choices.
If the number picked by user is less than number, then it will print “your guess is too high” and print an option from wrong list of choices.
If the number picked by user is less than number, then it will print “your guess is too high” and print an option from right list of choices.
The loops which are used to repeat a statement until a condition is met are?
While Loop
Do while Loop.
For loop
All the above
What will be the output of given program?
0,1,3,6,10,15,21,28,36,45
1,3,6,10,15,21,28
0,3,6,10,15,21,28,36,45
All the above
what will be the output of given program?
A) [Output image: 1 john\n2 john\n3 john\n4 john\n5 john]
B) [Output image: 1 john\n3 john\n5 john]
