Professional Documents
Culture Documents
Unit 1: What Are Lists in Python?: Week 2: Lists and Loops
Unit 1: What Are Lists in Python?: Week 2: Lists and Loops
Consider the following situation: You want to collect the names of people
showing up at your party.
▪ You can read the names using input()
▪ Once the user adds no further names:
– Sort the names alphabetically
– Print all the names
Problem: It is unknown how many variables are needed to store all the names.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 2
What are lists in Python?
Lists require a specific syntax
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 3
What are lists in Python?
Showtime
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 4
What are lists in Python?
Summary / key takeaways
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 5
Thank You!
Contact Information:
open@sap.com
This under
This work is licensed work isa licensed
Creativeunder a Creative
Commons Commons Attribution-ShareAlike
Attribution-ShareAlike 4.0 International 4.0 International License.
License. open.sap.com Slide 6
Week 2: Lists and Loops
Unit 2: Using an Index to Access Lists
Using an index to access lists
Each element in the list has a unique index
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 2
Using an index to access lists
Nested lists
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 3
Using an index to access lists
Showtime
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 4
Using an index to access lists
Summary / key takeaways
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 5
Thank You!
Contact Information:
open@sap.com
This under
This work is licensed work isa licensed
Creativeunder a Creative
Commons Commons Attribution-ShareAlike
Attribution-ShareAlike 4.0 International 4.0 International License.
License. open.sap.com Slide 6
Week 2: Lists and Loops
Unit 3: Important Functions and Methods for Lists
Important functions and methods for lists
There are various functions and methods with respect to lists
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 2
Important functions and methods for lists
Showtime
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 3
Important functions and methods for lists
Summary / key takeaways
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 4
Thank You!
Contact Information:
open@sap.com
This under
This work is licensed work isa licensed
Creativeunder a Creative
Commons Commons Attribution-ShareAlike
Attribution-ShareAlike 4.0 International 4.0 International License.
License. open.sap.com Slide 5
Week 2: Lists and Loops
Unit 4: Iterating Using the For Loop
Iterating using the for loop
Accessing the complete list vs. accessing each individual element of the list
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 2
Iterating using the for loop
Showtime
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 3
Iterating using the for loop
Summary / key takeaways
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 4
Thank You!
Contact Information:
open@sap.com
This under
This work is licensed work isa licensed
Creativeunder a Creative
Commons Commons Attribution-ShareAlike
Attribution-ShareAlike 4.0 International 4.0 International License.
License. open.sap.com Slide 5
Week 2: Lists and Loops
Unit 5: Using Ranges to Create Sequences of
Numbers
Using ranges to create sequences of numbers
Programming often requires sequences of numbers
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 2
Using ranges to create sequences of numbers
Showtime
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 3
Using ranges to create sequences of numbers
Summary / key takeaways
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 4
Thank You!
Contact Information:
open@sap.com
This under
This work is licensed work isa licensed
Creativeunder a Creative
Commons Commons Attribution-ShareAlike
Attribution-ShareAlike 4.0 International 4.0 International License.
License. open.sap.com Slide 5
Week 2: Lists and Loops
Unit 6: Sequences
Sequences
Sequence types share common characteristics
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 2
Sequences
Showtime
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 3
Sequences
Summary / key takeaways
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 4
Thank You!
Contact Information:
open@sap.com
This under
This work is licensed work isa licensed
Creativeunder a Creative
Commons Commons Attribution-ShareAlike
Attribution-ShareAlike 4.0 International 4.0 International License.
License. open.sap.com Slide 5
Week 2: Lists and Loops
Unit 7: Slicing
Slicing
Accessing not single elements but parts of sequences
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 2
Slicing
Showtime
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 3
Slicing
Summary / key takeaways
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 4
Thank You!
Contact Information:
open@sap.com
This under
This work is licensed work isa licensed
Creativeunder a Creative
Commons Commons Attribution-ShareAlike
Attribution-ShareAlike 4.0 International 4.0 International License.
License. open.sap.com Slide 5
Week 2: Lists and Loops
Unit 8: List Comprehension
List comprehension
Simple list editing
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 2
List comprehension
Showtime
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 3
List comprehension
Summary / key takeaways
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. open.sap.com Slide 4
Thank You!
Contact Information:
open@sap.com
This under
This work is licensed work isa licensed
Creativeunder a Creative
Commons Commons Attribution-ShareAlike
Attribution-ShareAlike 4.0 International 4.0 International License.
License. open.sap.com Slide 5