
Sign up to save your podcasts
Or


Welcome to Coding 101 - It's the TWiT show that gives YOU the knowledge to live in the wonderful world of the programmer. This week we are introducing our newest module, Python with Code Warrior Dale Chase!
To see all the code used in today's episode, go to Our Github Repository for Module 2
Printing Everything within a List:The way we've been printing lists is to use a "for loop" to print everything within the list:
podcasters = ['Leo','Lisa','Padre', 'Snubs', 'Bryan', 'OMGchad']
for entries in range (0,6):
- print podcasters[entries]
If we JUST wanted to know the contents of the list:
mylist = [142, 512, 'dog', 'cat', 'bird', 123]
print mylist
Sorting the List
SortMe = [1, 23, 6, 4, 99]
for entries in range (0,5):
- print SortMe[entries]
raw_input ("Press Enter")
SortMe.sort();
for entries in range (0,5):
- print SortMe[entries]
NON-DESTRUCTIVE SORTING
podcasters = ['Leo','Lisa','Padre', 'Snubs', 'Bryan', 'OMGchad', 1234]
print podcasters
print "Woot, let's sort!"
sortedpodcasters = sorted(podcasters)
raw_input("Press Enter to Continue")
print podcasters
print sortedpodcasters
podcasters = ['Leo','Lisa','Padre', 'Snubs', 'Bryan', 'OMGchad', 1234]
print sorted(podcasters)
Tuples
twit_tuples = [
('Padre', 'TWiET', 72),
('Snubs', 'C101', 22),
('Bryan', 'KnowHow', 6),
]
print twit_tuples
Sorting Tuples
twit_tuples = [
('Padre', 'TWiET', 72),
('Snubs', 'C101', 22),
('Bryan', 'KnowHow', 6),
]
print sorted(twit_tuples, key=lambda twit: twit[2])
Hosts: Fr. Robert Ballecer, SJ and Shannon Morse
Guest: Dale Chase
Bandwidth for Coding 101 is provided by CacheFly.
Sponsors:
By TWiT4
44 ratings
Welcome to Coding 101 - It's the TWiT show that gives YOU the knowledge to live in the wonderful world of the programmer. This week we are introducing our newest module, Python with Code Warrior Dale Chase!
To see all the code used in today's episode, go to Our Github Repository for Module 2
Printing Everything within a List:The way we've been printing lists is to use a "for loop" to print everything within the list:
podcasters = ['Leo','Lisa','Padre', 'Snubs', 'Bryan', 'OMGchad']
for entries in range (0,6):
- print podcasters[entries]
If we JUST wanted to know the contents of the list:
mylist = [142, 512, 'dog', 'cat', 'bird', 123]
print mylist
Sorting the List
SortMe = [1, 23, 6, 4, 99]
for entries in range (0,5):
- print SortMe[entries]
raw_input ("Press Enter")
SortMe.sort();
for entries in range (0,5):
- print SortMe[entries]
NON-DESTRUCTIVE SORTING
podcasters = ['Leo','Lisa','Padre', 'Snubs', 'Bryan', 'OMGchad', 1234]
print podcasters
print "Woot, let's sort!"
sortedpodcasters = sorted(podcasters)
raw_input("Press Enter to Continue")
print podcasters
print sortedpodcasters
podcasters = ['Leo','Lisa','Padre', 'Snubs', 'Bryan', 'OMGchad', 1234]
print sorted(podcasters)
Tuples
twit_tuples = [
('Padre', 'TWiET', 72),
('Snubs', 'C101', 22),
('Bryan', 'KnowHow', 6),
]
print twit_tuples
Sorting Tuples
twit_tuples = [
('Padre', 'TWiET', 72),
('Snubs', 'C101', 22),
('Bryan', 'KnowHow', 6),
]
print sorted(twit_tuples, key=lambda twit: twit[2])
Hosts: Fr. Robert Ballecer, SJ and Shannon Morse
Guest: Dale Chase
Bandwidth for Coding 101 is provided by CacheFly.
Sponsors:

202 Listeners

78 Listeners

355 Listeners

8 Listeners

3 Listeners

7 Listeners

3 Listeners