[ECE 101] - Midterm Exam Guide - Comprehensive Notes for the exam (18 pages long!)

338 views18 pages

Document Summary

A deep copy will copy the value of the variable not just their handle. So, if you are creating a deep copy you are duplicating the variable. Copy copy the memory location handle number. Deep copy copies the content stored in the memory location and creating a duplicate. If you change l2, l1 will change as well. * repeat whatever in the list number of times indicated after the sign. L1 = [4] l1 is a pointer (it is an address (just a number) + it is the symbolic name of a memory location . It points towards some information which translate to a list with the integer value of four. L2 = l1 l2 is pointing towards the same thing l1 is pointing at. Def show(self): print(self. x,self. y) myobj1= myclass(0,0) myobj2= myclass(4,5) myobj3 = myobj1 myobj1. inc_x() myobj1. show() myobj2. show() myobj3. show() These are variables that you initiate before typing any method. We are going to start working with robots .