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

INTRODUCTION TO PROGRAMING IN PYTHON (MIDTERM EXAM) EXAM 1 QUESTIONS AND

Rating
-
Sold
-
Pages
8
Grade
A+
Uploaded on
19-06-2025
Written in
2024/2025

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

Show more Read less
Institution
INTRODUCTION TO PROGRAMING IN PYTHON
Module
INTRODUCTION TO PROGRAMING IN PYTHON









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

Written for

Institution
INTRODUCTION TO PROGRAMING IN PYTHON
Module
INTRODUCTION TO PROGRAMING IN PYTHON

Document information

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

Subjects

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

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.
STANGRADES Stanford University
Follow You need to be logged in order to follow users or courses
Sold
45
Member since
1 year
Number of followers
1
Documents
9363
Last sold
1 day ago
STAN-GRADES

EXCELLENCY IN ACADEMIC MATERIALS

3.2

10 reviews

5
3
4
1
3
3
2
1
1
2

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 exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight 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 smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions