Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Total: 10 pts True or False. 1pt for each. 1. These steps reflect the operation of all assignments in the Python language: 1) create an

image text in transcribed

Total: 10 pts True or False. 1pt for each. 1. These steps reflect the operation of all assignments in the Python language: 1) create an object to represent the value; 2) then create the variable if this variable does not yet exist; 3) finally, link this variable to the object created. 2. In Python, whenever a name is assigned to a new object, the space held by the prior object is reclaimed if it is not referenced by any other name or object - that is, the object's space is automatically thrown back into the free space pool, to be reused for a future object. 3. For string a = "string", we do b=a a = "new string" we have b holding "new string". 4. For list I = [1, 2, 3, 4], we do 11 = 1 1.append(1) we have 11 holding the original value [1, 2, 3, 4] 5. After shallow coping 11 to 12(12 = copy.copy(11)) where 11 = [[2, 3, 4], ["a", "b", "c"]], even though we do 11[0][0] = 0, we can have 12 holding [[2, 3, 4], ["a", "b", "c"]]- 6. After deep coping 11 to 12(12 = copy.deepcopy(11)) where 11 = [[2, 3, 4], ["a", "b", "c"]], even though we do 11[0][0] = 0, we can have 12 holding [[2, 3, 4). ["a", "b", "c"]]. 7. These ways of coping list 11 to 12 are all shallow copies: 12 = 11[:). 12 = list(1). 12 = copy.copy(11). 8. For L = [1,2,3] M = [1, 2, 3] Land M holds the same value(True for L == M) but different id (False for Lis M). 9. For small numbers X = 42 Y = 42 X and Y holds the same value (True for X == Y) but different id (False for X is Y). 10. For large numbers X = 12321341234 Y = 12321341234 X and Y holds the same value (True for X == Y) but different id (False for X is Y)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

7. It is advisable to do favors for people whenever possible.

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago