NEW
Font size
S
M
L
XL
WorksheetsPSP Week3
Total questions: 10
Worksheet time: 3mins
Name
Class
Date
1.
What are the essential steps in the software engineering process? planet in the Solar System?
a)
Writing code, debugging, testing
b)
Understanding the problem, coming up with a solution, writing the program, and testing
c)
Gathering requirements, coding, and documentation
2.
How can source code be converted into machine code for execution?
a)
It's directly executed by the machine.
b)
compilation or interpretation
c)
Trace table
3.
Which of the following is not a valid variable name in Python?
a)
123a
b)
a123b
c)
a_b
4.
How can you read user input in Python?
a)
input("Enter your name: ")
b)
read("Enter your name: ")
c)
get("Enter your name: ")
5.
How can you display information to the user in Python?
a)
show("Hello, world!")
b)
output("Hello, world!")
c)
print("Hello, world!")
6.
Which programming construct is used to make decisions in Python?
a)
Iteration
b)
Selection
c)
Looping
7.
What does the len function return for a string?
a)
The number of spaces in the string
b)
The length of the string
c)
The number of characters in the string
8.
How can you join two strings together in Python?
a)
str1 + str2
b)
str1.join(str2)
c)
str1.concat(str2)
9.
What is the output of a[1:3] for the string "Hello"?
a)
"He"
b)
"ll"
c)
"el"
10.
How can you reverse a string using slicing in Python?
a)
string[::1]
b)
string[::-1]
c)
string[0:-1]
Reset
