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

CRPC Questions with Detailed Verified Answers

Rating
-
Sold
-
Pages
27
Grade
A+
Uploaded on
02-07-2025
Written in
2024/2025

CRPC Questions with Detailed Verified Answers

Institution
CSC148
Course
CSC148










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

Written for

Institution
CSC148
Course
CSC148

Document information

Uploaded on
July 2, 2025
Number of pages
27
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

Page | 1



CSC148 Questions with Detailed
Verified Answers

Question: the only mutable types
Answer: list and dictionaries and user defined classes


Question:Where is all data stored in?
Answer: objects that have 3 components -> id, type and value


Question:What is special about id
Answer: The id of an object is a unique identifier, meaning that no other
object has the same identifier.


Question:difference between object and variable?
Answer: a variable stores an object with value, id and type
Variables are not objects because it doesn't store data but only storing the id.
it REFERS to an object


Question:What is special about the type of object
Answer: it defines what operators you can use on it


Question:3 + 'hello'
Answer: TypeError: unsupported operand type(s) for +: 'int' and 'str'


Question:>>> prof = 'Diane'

, Page | 2

>>> id(prof)
4405312456
>>> prof = prof + ' Horton'
>>> prof
'Diane Horton'
>>> id(prof)
Answer: >>> # The old str object couldn't change, so Python made a new
>>> # str object for the variable prof to refer to. Since it's
>>> # a new object, it has a different id.
>>> id(prof)
4405308016


Question:what is aliasing?
Answer: referring to the same object so they have the same id


Question:phrase this "z = x" in english
Answer: "make z refer to the object that x refers to."


Question:y = y
id value changes?
Answer: no, just like how x= y means they now have the same id,
y = y will also have the same id as before


Question:y = [1,2,3]
x = [1,2,3]
id(y)
id(x)

, Page | 3

Answer: >>> id(y)
2493677724232
>>> id(x)
2493677724296


Question:>>> x = [1, 2, 3]
>>> z = x
>>> z[0] = -999
>>> x
Answer: x = [-999, 2,3]


Question:what if you want to check if two variables value are exactly the
same?
Answer: "== " compares the values stored in the objects reference. This is
called value equality.


Question:what if you want to check if the variables are referring to the exact
same object
Answer: "is" like x is y, which will check the id


Question:special case for immutable stuff?
Answer: >>> x = 'foo'
>>> y = 'foo'
>>> x is y
True
HOWEVER
>>> x = "ice cream"
CA$19.06
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached


Also available in package deal

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.
Ivie Southern New Hampshire University
Follow You need to be logged in order to follow users or courses
Sold
19
Member since
8 months
Number of followers
1
Documents
7150
Last sold
2 days ago

3.3

6 reviews

5
2
4
1
3
1
2
1
1
1

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