WorksheetsIST P-STEM Unit 1 Hardware and Python Review
Total questions: 20
Worksheet time: 14mins
Which of the following is an input device?
mouse
speaker
monitor
printer
Which of the following is true about main memory?
main memory is used for long-term data storage
main memory is the short-term memory also known as RAM
main memory is preserved in the computer system even when the power is turned off or lost
a solid state drive (SSD) is an example of main memory in a computer system
Which of the following software controls the memory of the computer?
operating system (OS)
compiler
Python
applications
What is the correct order of steps that a compiler uses in translating code?
Translate commands to machine language. Check for mistakes. Run the commands.
Check for mistakes. Translate commands to machine language. Run the commands.
Run the commands. Check for mistakes. Translate commands to machine language.
Run the commands. Translate commands to machine language. Check for mistakes.
Which of these is an example of output?
Displaying information on the screen
Storing data in main memory
Converting code to machine language
Putting information into the computer
Which of the following is a legal variable name?
tempVar
70nums
&&data
num of mins
Two categories of variable data types are:
Strings and integers
Strings and words
integers and numbers
words and floats
What command is used to change a number into a String?
str()
int()
dec()
print()
What is output by the following?
print("Row\nRow\nRow yer boat")
Row
Row
Row yer boat
Row\nRow\nRow yer boat
Row Row Row yer boat
Row Row
Row yer boat
What is output by the following?
print(type("121"))
<class 'str'>
<class 'num'>
error. unknown identifier
<class 'int'>
What is output by the following? Assume the user enters 12 and 25.
x = input("Enter a number: ")
y = input("Enter a number: ")
print("Values are: " + x + y)
Values are: 1225
Values are: 37
error. data type mismatch
Values are: xy
What symbol is used to begin a comment in Python?
#
com()
str()
*
What is output by the following program?
x = "wrench"
y = x
z = "hammer"
print(x + " " + y + "\n" + z)
wrench wrench
hammer
wrench x hammer
wrench wrench hammer
wrench x
hammer
What does the program do?
num1 = int(input("Enter a number: ")
num2 = int(input("Enter a number: ")
print("The answer is: " + str(num1 + num2))
the program accepts two integers as input and prints out the sum
the program accepts two numbers as input and prints the answer
the program outputs: The answer is: num1 + num2
the program accepts two integers as input and prints out the two numbers again
Consider the following code:
x = input("How old are you? ")
print(x)
What data type is stored in x?
String
integer
float
word
What is a downside (disadvantage) of converting information from an analog to a digital format?
Some of the detailed information is lost
When the power is turned off, information is lost
Limits the technology available
Digital information takes up too much space in memory
When is it a good idea to use integers instead of Strings?
When doing calculations with whole numbers
When processing large amounts of data
When we want to store someone's username and password
When a variable is holding both words and numbers
Which of the following statements about computers is true?
Computers do not always need electricity to operate
Computing devices translate analog information into a digital format in order to process and store it
The CPU is the long-term memory center of the computer
The RAM is the brain of the computer that processes commands
Convert the decimal number 14 into binary:
1110
1111
1101
1100
Convert the binary number 1001100 into decimal:
76
74
78
80
