Python Essentials II�Module 3 - 3.6.1.1 ~ 3.6.1.9
Cisco Networking Academy Introduction
1
STEAM Clown ™ Productions
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Licensing & Attribution
Open Source Philosophy - I have come to realize that I’m really not competing with other teachers. Maybe I have some local competition, but in reality, if a student is not coming to my class or my school, then I’m not competing with other teachers in any way… If you work more than a District away, then we really are not competitors. Let's Share... Collaborate... Help each other... I, and you, may have sweat blood and tears developing a lesson plan, a lab, or presentation… There is an ENORMOUS unpaid value there… I get that… I don’t begrudge teachers who are trying to sell their collateral… I’m just saying that is not what I’m going to do. But that is my plan. I’m going to share virtually everything I develop. Join Me!!! See More
CC BY-NC-SA 4.0
https://creativecommons.org/licenses/by-nc-sa/4.0/
https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
GNU Public License & EUPL (European Union Public Licence)
Any included or linked Programming Code Is licensed under GNU General Public License v3.0 & and / or licensed under EUPL 1.2 or later
See the Appendix for Additional Licensing & Attribution Information
2
Please maintain this slide with any
modifications you make
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Resources & Materials Needed
3
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
👉 Try This:
4
print("Hisssssssssss")
Try This 👉
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Sections Covered In This Lesson
3.6.1.1 - The inner life of lists
3.6.1.2 - Powerful slices
3.6.1.3 - Slices - negative indices
3.6.1.4/5 - Slices continued
3.6.1.6 - The in and not in operators
3.6.1.6/7/8 - Lists - some simple programs
3.6.1.9 - Lab
5
Try This 👉
Work all the code examples in the sections
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Key Concepts & Topics...
6
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Key Concepts & Topics...
7
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Your Take-Away From These Sections
8
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Can You Answer These Questions?
What is the output?�list_1 = ["A", "B", "C"]
list_2 = list_1
list_3 = list_2
del list_1[0]
del list_2[0]
print(list_3)
What is the output?�list_1 = ["A", "B", "C"]�list_2 = list_1�list_3 = list_2�del list_1[0]�del list_2�print(list_3)�print(list_2)
What is the output?�list_1 = ["A", "B", "C"]
list_2 = list_1
list_3 = list_2
del list_1[0]
del list_2[:]
print(list_3)
9
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Can You Answer These Questions?
What is the output?�list_1 = ["A", "B", "C"]�list_2 = list_1[:]�list_3 = list_2[:]�del list_1[0]�del list_2[0]�print(list_3)
Insert in or not in, in place of ??? to get expected result
my_list = [1, 2, "in", True, "ABC"]
print(1 ??? my_list) # outputs True
print("A" ??? my_list) # outputs True
print(3 ??? my_list) # outputs True
print(False ??? my_list) # outputs False
10
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Thank You…
Questions?
11
If you are in one of my classes, you can probably send / post questions in:
STEAM Clown ™ Productions
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Reference Slides
12
STEAM Clown ™ Productions
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Education Standards
13
13
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Quiz Answers
14
list_2 = list_1� list_3 = list_2� del list_1[0]� del list_2[0]� print(list_3)��Answer: [‘C’]�
2. � list_1 = ["A", "B", "C"]� list_2 = list_1� list_3 = list_2� del list_1[0]� del list_2� print(list_3)� print(list_2)
Answer: ['B', 'C']� list_2 is undefined��3.� list_1 = ["A", "B", "C"]� list_2 = list_1� list_3 = list_2� del list_1[0]� del list_2[:]� print(list_3)
Answer: []
�
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Quiz Answers
15
4. Outputs?�list_1 = ["A", "B", "C"]�list_2 = list_1[:]�list_3 = list_2[:]�del list_1[0]�del list_2[0]�print(list_3)
Answer: ['A', 'B', 'C'] # because list_3 is an independent copy of original not touched
5. Insert in or not in, in place of ??? to get expected result��my_list = [1, 2, "in", True, "ABC"]
print(1 ??? my_list) # outputs True
print("A" ??? my_list) # outputs True
print(3 ??? my_list) # outputs True
print(False ??? my_list) # outputs False
Answer: �print(1 in my_list) # outputs True
print("A" not in my_list) # outputs True
print(3 not in my_list) # outputs True
print(False in my_list) # outputs False
�
�
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Appendix
16
STEAM Clown ™ Productions
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Appendix : Primary Sources & Attribution for Material Used
17
Please maintain this slide with any modifications you make
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
Image Reference & Sources
18
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions
What To Fix, Add, Or Change
Presentation Planning:
19
© Copyright - STEAM Clown TM
Creative Commons Licenses - BY-NC-SA 4.0
STEAM Clown TM Productions