100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

WLU CP104 Intro To Programming Midterm Review Answers new study guide solution Wilfrid Laurier University

Rating
-
Sold
-
Pages
17
Grade
A+
Uploaded on
13-02-2025
Written in
2024/2025

WLU CP104 Intro To Programming Midterm Review Answers new study guide solution Wilfrid Laurier University

Institution
WLU CP104
Course
WLU CP104










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
WLU CP104
Course
WLU CP104

Document information

Uploaded on
February 13, 2025
Number of pages
17
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

WLU CP104 Intro To Programming Midterm Review Answers
new study guide solution Wilfrid Laurier University




CP104 Introduction to Programming Mid Term Review Questions

Part 1 – True/False Questions

a. In Python, print statements written on separate lines do not
necessarily output on separate lines. F
b. The \t escape character causes the output to skip over to the next
horizontal tab.T
c. Since a named constant is just a variable, it can change any time during
a program's execution.F
d. In Python, math expressions are always evaluated from left to right, no
matter what the operators are. F
e. According to the behavior of integer division, when an integer is divided by
an integer, the result will be a float. F
f. Computer programs typically perform three steps: input is received,
some process is performed on the input, and output is produced. T
g. The if statement causes one or more statements to execute only when
a Boolean expression is true. T
h. The following code snippet will change the turtle's pen size to 4 if it is
presently less than 4: T
i. if turtle.pensize() < 4:
j. turtle.pensize(4)




k. Both of the following for clauses would generate the same number of loop
iterations. T
for num in range(4):
for num in range(1, 5):

,l. To get the total number of iterations in a nested loop, add the number of
iterations in the inner loop to the number in the outer loop. F


m. A while loop is called a pretest loop because the condition is tested after
the loop has had one iteration. F

, n. A function definition specifies what a function does and causes the
function to execute. F

o. Python allows you to pass multiple arguments to a function. T



p. A local variable can be accessed from anywhere in the program. F

q. A value-returning function is like a simple function except that when it
finishes it returns a value back to the part of the program that called it. T

Part 2 – Multiple Choice Questions

The function reads a piece of data that has been entered at the
keyboard and returns that piece of data, as a string, back to the program.
a. input()
b. output()
c. eval_input()
d. str_input()


The line continuation character is a
a. #
b. %
c. &
d. \


Which mathematical operator is used to raise 5 to the second power in Python?
a. /
b. **
c. ^
d. ~


In a print statement, you can set the argument to a space or empty string
to stop the output from advancing to a new line.
a. stop
b. end
c. separator

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
smartzone Liberty University
View profile
Follow You need to be logged in order to follow users or courses
Sold
3192
Member since
5 year
Number of followers
2291
Documents
14354
Last sold
1 day ago
AMAIZING EDUCATION WORLD

GET ALL KIND OF EXAMS ON THIS PAGE ,COMPLETE TEST BANKS,SUMMARIES,STUDY GUIDES,PROJECT PAPERS,ASSIGNMENTS,CASE STUDIES, YOU CAN ALSO COMMUNICATE WITH THE SELLER FOR ANY PRE-ORDER,ORDER AND ETC.

3.7

584 reviews

5
260
4
93
3
103
2
29
1
99

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions