• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 8 pages
Exam (elaborations)

Introduction To Programing In Python (Midterm Exam) Exam 1 Questions And

Document preview thumbnail
Preview 2 out of 8 pages

INTRODUCTION TO PROGRAMING IN PYTHON (MIDTERM EXAM) EXAM 1 QUESTIONS AND ANSWERS What is a common word for the textual representation of a program? - CORRECT ANSWERcode Which type of error does not cause the program to crash? - CORRECT ANSWERlogic error

Content preview

INTRODUCTION TO PROGRAMING IN PYTHON (MIDTERM EXAM)
EXAM 1 QUESTIONS AND ANSWERS
What is a common word for the textual representation of a program? - CORRECT
ANSWER✅✅✅code



Which type of error does not cause the program to crash? - CORRECT ANSWER✅✅✅logic error



Basic instruction types are input, process, and _____. - CORRECT ANSWER✅✅✅output



Dividing by zero is an example of which type of error? - CORRECT ANSWER✅✅✅runtime



Which program can be used to create a Python file that can be used directly by the interpreter? -
CORRECT ANSWER✅✅✅IDLE editor



Which statement has a syntax error? Assume variables x, y, z, and age have already been defineD. -
CORRECT ANSWER✅✅✅x + y = z



What is the ending value of z?

x = 0.3z = math.pow(math.ceil(x), 2) - CORRECT ANSWER✅✅✅1.0



Which statement is true regarding the pop() method for sets? - CORRECT ANSWER✅✅✅pop()
removes a random item in the set.



15 _____ 3 = 5.0 - CORRECT ANSWER✅✅✅/



Which of the following expressions causes an implicit conversion between types? Assume variable x is
an integer, t is a float, and name is a string. - CORRECT ANSWER✅✅✅7.5 + (x / 2)



Which statement makes the code in the math module available? - CORRECT ANSWER✅✅✅import
math

, A _____ is a word that is part of the Python language and can't be used as a variable name. - CORRECT
ANSWER✅✅✅keyword



Which data type is the correct choice to store the names of all the hockey players who have scored 3 or
more goals in a single game in no specific order? - CORRECT ANSWER✅✅✅set



Which data type is the correct choice to store the number of wins associated with each basketball team
in the NBA? - CORRECT ANSWER✅✅✅dict



What is the base 10 representation of the binary number: 00101110? - CORRECT ANSWER✅✅✅46



What is the value of the __name__ built-in variable in a module that is executed as a script by the
programmer? - CORRECT ANSWER✅✅✅__main__



Which operator is evaluated last in an expression? - CORRECT ANSWER✅✅✅or



What conditions have to be true to make the following code display "B"?

if color == 'red':if style < 3:print('A')elif style < 5:print('B')else:print('C')elif color == 'blue':print('D') -
CORRECT ANSWER✅✅✅color is 'red' and style is 4



What is x's final value?

x = 10y = 20if y <= 2 * x:x = x + 5else:x = x * 2 - CORRECT ANSWER✅✅✅15



Which branch structure is necessary if a program needs to output "Yes" if a variable's value is positive,
or "No" otherwise? - CORRECT ANSWER✅✅✅if-else



What condition should replace ZZZ to output "Same name" only if the values of two variables are the
same?

my_name = input("Enter my name: ")your_name = input("Enter your name: ")if ZZZ:print("Same name")
- CORRECT ANSWER✅✅✅my_name == your_name

Document information

Uploaded on
June 19, 2025
Number of pages
8
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$11.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
STANGRADES
3.3
(16)
Sold
103
Followers
2
Items
12022
Last sold
1 week ago



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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions