KEMBAR78
Python Programming Essentials - M15 - References | PPTX
http://www.skillbrew.com
/SkillbrewTalent brewed by the industry itself
References
Pavan Verma
@YinYangPavan
1
Founder, P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials
© SkillBrew http://skillbrew.com
References
ios
android
windows
2
platforms = ['ios', 'android', 'windows']
mobile_platforms = platforms
platforms
mobile_platforms
Both variables refer
to same list in
memory
© SkillBrew http://skillbrew.com
References (2)
ios
android
Firefox
3
platforms[2] = 'firefox‘
print mobile_platforms
['ios', 'android', 'firefox']
platforms
mobile_platforms
Both variables refer to
same list in memory
© SkillBrew http://skillbrew.com
References (3)
When you create an object and assign it to a variable,
the variable only refers to the object and does not
represent the object itself
4
© SkillBrew http://skillbrew.com
Resources
 References
http://ibiblio.org/g2swap/byteofPython/read/references.html
5

Python Programming Essentials - M15 - References

Editor's Notes

  • #3 Platforms and mobile_platforms both refer to same list in memory mobile_platforms = platforms does not create a copy of list instead they are just two variable names referring to the same list
  • #4 On changing platforms, the change is also reflected in variable mobile_platforms