Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
976 commits
Select commit Hold shift + click to select a range
10f063d
passing test for adding in a slice longer than advertised. probably c…
codedragon Dec 7, 2014
4f8a5d9
cleaned up session 09 and added ipython log.
PythonCHB Dec 7, 2014
9e9411e
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Dec 7, 2014
40629f2
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
Dec 7, 2014
6ac1402
modified Fukuhara_v1 file, deleted dupe file in WFukuhara folder
Dec 7, 2014
8a4fb8f
Adding new file, disneystock.csv. Deleting dupe of another file
Dec 7, 2014
182b9a4
All of HW for last three classes
Dec 7, 2014
37c20cf
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
voite1 Dec 9, 2014
de7ff16
Added Week 9 notes
voite1 Dec 9, 2014
558c611
Updating
voite1 Dec 9, 2014
4e02418
Adding Final Project Files
voite1 Dec 9, 2014
c6a0107
Fukuhara final project
Dec 10, 2014
13b1a98
session 10
PythonCHB Dec 10, 2014
b36a2e2
Finished Session 09 Homework.
salimhamed Dec 10, 2014
cd036a2
May have fixed unicode errors by adding from __future__ line, now try…
saschwafel Dec 10, 2014
71ceebf
Removed lambda_keyword.pyc file because it was associated with the push.
Dec 10, 2014
81e85d3
adding class notes and beginning of unicode lab
saschwafel Dec 10, 2014
34e31c5
Changing API for geolocation, working on why printing the complete li…
Dec 10, 2014
4257e2f
String formatting fixed NoneType issues
Dec 10, 2014
c6a1f46
Initial checkin for final project
gosunfish Dec 11, 2014
ee1dc3b
Initial checkin for final project
gosunfish Dec 11, 2014
082c2ec
Troubleshooting geolocation
Dec 11, 2014
8869c1a
Final commit of project files.
Dec 12, 2014
0ff02a7
Merge pull request #87 from saschwafel/master
PythonCHB Dec 12, 2014
3d1e969
Merge pull request #84 from salimhamed/master
PythonCHB Dec 12, 2014
ac1ec61
cleaned up a bit more, and added .gitignore to .gitignore
PythonCHB Dec 12, 2014
72063f4
Merge branch 'session_09' of https://github.com/Anastomose/IntroToPyt…
PythonCHB Dec 12, 2014
cd68b7f
Merge branch 'Anastomose-session_09'
PythonCHB Dec 12, 2014
6b77dae
Session 10 Homework
salimhamed Dec 12, 2014
f5d6b5c
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
salimhamed Dec 12, 2014
f2fbe05
:Project loaded
Dec 13, 2014
5c1b9ce
Final file update for final class project. Sample data included.
ARSimmons Dec 13, 2014
6ee3091
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
voite1 Dec 13, 2014
9acf6f5
Merge pull request #91 from voite1/master
PythonCHB Dec 13, 2014
7cc9bf8
Merge pull request #90 from dfugelso/master
codedragon Dec 13, 2014
e6bb8be
Merge pull request #92 from WayneUW/master
codedragon Dec 13, 2014
c8faec6
Merge pull request #98 from salimhamed/master
PythonCHB Dec 14, 2014
b689717
Merge pull request #97 from ARSimmons/master
PythonCHB Dec 17, 2014
625fa9f
Merge branch 'master' of https://github.com/gosunfish/IntroToPython i…
PythonCHB Dec 18, 2014
09df765
Merge branch 'gosunfish-master'
PythonCHB Dec 18, 2014
7e0e659
Added a couple additional references.
PythonCHB Apr 25, 2015
ce7a8ab
added studetn's project file -- for the record.
PythonCHB Sep 14, 2015
7a0a5e2
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Sep 14, 2015
754c2de
start of update to the syllabus
PythonCHB Sep 14, 2015
2a412ca
updated dates and books and python 3 in Syllabus
PythonCHB Sep 14, 2015
99579a2
removed all student work
PythonCHB Sep 14, 2015
2e5d97c
updated syllabus with learning goals
PythonCHB Sep 14, 2015
d83a3eb
added extra boilerplate to the syllabus
PythonCHB Sep 14, 2015
404c015
added a reference to one of Hettingger's talks.
ChrisBarker-NOAA Sep 16, 2015
4694b92
another link...
ChrisBarker-NOAA Sep 16, 2015
c9f14b8
removed persistance
PythonCHB Sep 18, 2015
84ac21c
Merge branch 'fall_2015'
PythonCHB Sep 18, 2015
94adcdf
updated install instructions
PythonCHB Sep 22, 2015
c8405e8
update debian and related distros and notes
ranchodeluxe Sep 29, 2015
3a7350e
Ubuntu not Debian
ranchodeluxe Sep 29, 2015
83d2a98
try some footnotes
ranchodeluxe Sep 30, 2015
ab15ec5
Update python_for_linux.rst
ranchodeluxe Sep 30, 2015
7b24804
Update python_for_linux.rst
ranchodeluxe Sep 30, 2015
b42c15d
Update python_for_linux.rst
ranchodeluxe Sep 30, 2015
d88d469
Update python_for_linux.rst
ranchodeluxe Sep 30, 2015
e5bfc7a
Update python_for_linux.rst
ranchodeluxe Sep 30, 2015
7701015
Add CentOS notes
ranchodeluxe Sep 30, 2015
30089ce
Update python_for_linux.rst
ranchodeluxe Sep 30, 2015
3cdcf81
Update python_for_linux.rst
ranchodeluxe Sep 30, 2015
876474c
Update python_for_linux.rst
ranchodeluxe Sep 30, 2015
b15ad5d
Update python_for_linux.rst
ranchodeluxe Sep 30, 2015
68ae3bb
Merge pull request #127 from thebigspoon/fall_2015
PythonCHB Sep 30, 2015
cab1737
fixed a copule typos in the Linux instructions
ChrisBarker-NOAA Oct 1, 2015
f1848e9
fixed python installation for windows
Oct 3, 2015
807fc1b
fixed typos missed in previous fix of python installation for windows
Oct 3, 2015
c5258f3
made yet more improvements in the python installation for windows
Oct 3, 2015
eb3c31e
Merge branch 'fall_2015'
PythonCHB Oct 3, 2015
778ced0
updating session 1 -- more to do.
PythonCHB Oct 4, 2015
b3c5d8e
updated references to "homework" to be to "excercises"
PythonCHB Oct 4, 2015
6ee73bf
lots of updaeing and some re-structuring
PythonCHB Oct 5, 2015
9e41051
updated lightning talk scheduler...
PythonCHB Oct 6, 2015
d2a2558
fixed a few tpos in the Windows instructions
PythonCHB Oct 6, 2015
b0fb1c2
cleaned out solutions
PythonCHB Oct 6, 2015
d22e26c
updated session one with my info. added a clarification to windows in…
Oct 6, 2015
f4d0fc5
added git intro links to session 1
PythonCHB Oct 6, 2015
344778d
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
Oct 6, 2015
be1b5f0
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
Oct 6, 2015
83df821
tiny typo fix
Oct 6, 2015
a3eaa5e
cleaned up a few things in the first lecture
PythonCHB Oct 7, 2015
8ff2983
built lighting talk schedule
PythonCHB Oct 7, 2015
440cfa7
a start on updating session 2
PythonCHB Oct 10, 2015
600398a
updating grid printer excercise
PythonCHB Oct 10, 2015
96327d7
updated test file
PythonCHB Oct 11, 2015
d49c222
split session02 so that some git stuff is now in a new supplement, st…
Oct 12, 2015
578dc86
a start on session 2...
PythonCHB Oct 12, 2015
e63089b
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Oct 12, 2015
bc2c030
created instructions for nano on windows, started more hands-on intro…
Oct 12, 2015
4983a73
made git more of a do-together kind of thing, instead of a lecture
Oct 12, 2015
356ab75
refactored session 2 -- needs formatting checks
PythonCHB Oct 12, 2015
5eb8f6b
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Oct 12, 2015
0a6d087
updated build_gh_pages script
PythonCHB Oct 12, 2015
abcd474
updating presentation materials
Oct 12, 2015
395a660
making image behave itself, at least a bit better
Oct 12, 2015
b7a10a2
merging because was not fast enough pushing
Oct 12, 2015
70796a7
all done but the proofreading...
PythonCHB Oct 13, 2015
e37effa
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Oct 13, 2015
6f77d5f
cleaned up accidental ading of slides to the repo
PythonCHB Oct 13, 2015
8eb225e
updated session3 -- started
PythonCHB Oct 17, 2015
1f5ca42
updated git instructions with new repo name
PythonCHB Oct 18, 2015
05cf129
some more toward session 3
PythonCHB Oct 18, 2015
03ac9f3
updates session 3 with new formatting methods
PythonCHB Oct 20, 2015
caf02e6
pretty much done with session 3 -- still some proofreading to do
PythonCHB Oct 20, 2015
42bb346
added slicing examples
PythonCHB Oct 21, 2015
88c7a69
fixed list lab link
PythonCHB Oct 21, 2015
57ffd5b
updated lightning talks
PythonCHB Oct 24, 2015
edec513
updated to python3 up to "Dict / Set Lab"
Oct 25, 2015
f183f99
did some more updating in session04 to python3
Oct 27, 2015
a4bab82
fixed rst in Syllablus
PythonCHB Nov 2, 2015
ef5df8b
updating session 5 notes
PythonCHB Nov 2, 2015
a4b13fa
updated session 5
PythonCHB Nov 4, 2015
31c9535
restructured a bit -- moved Exceptions and Argument passing to later …
PythonCHB Nov 8, 2015
e08610e
updated examples to py3
PythonCHB Nov 8, 2015
669aafe
updating / rearranging session 6
PythonCHB Nov 10, 2015
1734355
updated trapazoid exercise
PythonCHB Nov 10, 2015
1e3cf07
updating for session 6
PythonCHB Nov 11, 2015
4e4ddc4
updated trapezoidal rule exercise
PythonCHB Nov 11, 2015
9810fa7
added lambda magic
PythonCHB Nov 11, 2015
16957fd
updated the trapezoid excercise
PythonCHB Nov 14, 2015
fbc4166
added a bit more explaination to trapezoidal rule exercise
PythonCHB Nov 15, 2015
3d8e86a
added some links to the git tutorial
PythonCHB Nov 17, 2015
0542297
updated Examples for py3
PythonCHB Nov 17, 2015
c98a877
updating Session 7 notes
PythonCHB Nov 17, 2015
8f47060
updated the html render exercise
PythonCHB Nov 18, 2015
9eff39f
updated session 7 slides
PythonCHB Nov 18, 2015
819fb31
added the html_render sample output.
PythonCHB Nov 18, 2015
d40765c
updating Session 8 presentation -- more to do!
PythonCHB Nov 24, 2015
2aea6d2
more cleanup of Session 08 lectire notes -- more to do!
PythonCHB Nov 24, 2015
40873e8
re-arranging the presentations for the last threee classes.
PythonCHB Nov 25, 2015
fbbf5d7
final? update of session 8
PythonCHB Nov 25, 2015
22c98cd
updated iterators
Nov 29, 2015
9e44c1c
updated properties examples
PythonCHB Nov 29, 2015
d93f3ad
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Nov 29, 2015
0612d15
fixed underlining
Nov 29, 2015
6ecb67d
cleaned up some old stuff
PythonCHB Nov 29, 2015
4b155a8
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Nov 29, 2015
6940774
updated make pages for remote
Nov 29, 2015
1a6b3d2
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
Nov 29, 2015
dee58cf
updated iterator examples
Nov 29, 2015
aae9293
updated build_gh_pages script
PythonCHB Nov 29, 2015
d2603b3
did some more updating to python3
Dec 1, 2015
ba503a3
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
Dec 1, 2015
4b684b1
more updates from 2 to 3
Dec 1, 2015
25ac4f1
re-shuffled examples
PythonCHB Dec 7, 2015
e03ac78
updated Examples for py3
PythonCHB Dec 7, 2015
41365fe
finished updating exampels for py3
PythonCHB Dec 7, 2015
a1652d8
more work on updating presentation
PythonCHB Dec 7, 2015
d324fcc
a bit more cleanup
PythonCHB Dec 7, 2015
5cdab06
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Dec 7, 2015
30460ce
a few edits for to session 10
PythonCHB Dec 8, 2015
b13df7c
a littel more cleanup
PythonCHB Dec 8, 2015
8bb125d
a bit of clean up of session 10
PythonCHB Dec 9, 2015
e328996
added timer context example
PythonCHB Dec 9, 2015
db30d41
Future proofing by reducing references to specific subversion of Pyth…
Dec 12, 2015
38c33c1
Typo corrections, clairifications
Dec 13, 2015
930212c
Fix reference to sassc command line argument: --include-path kwarg do…
Dec 13, 2015
d1d3b28
Merge commit 'e328996a3a55d76e73037f0efc06d05fa87942c6' into rriehle-…
Dec 13, 2015
9ee3b07
Typo
Dec 13, 2015
4719845
Typos
Dec 13, 2015
344efcc
Fixed a ref tag
Dec 14, 2015
8286dd6
made sure git slides make sense and fixed a make slides error.
Jan 4, 2016
d230f21
Implement restructured text's mechanism for text substitution
Jan 7, 2016
47aa634
Merge branch 'master' into rriehle-2016-prep
Jan 7, 2016
cc1e776
updated class list for 2016
PythonCHB Sep 23, 2016
a1d7b04
updated THink Python link
PythonCHB Sep 23, 2016
504c757
minor changes in intro for new year
codedragon Sep 23, 2016
1836f23
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
codedragon Sep 23, 2016
62d5940
fancier gh-pages build script
PythonCHB Sep 23, 2016
de8fbba
updating presentation materials
codedragon Sep 23, 2016
c7ce191
fixed instructor names
codedragon Sep 23, 2016
411409a
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
codedragon Sep 23, 2016
54b626c
updating presentation materials
codedragon Sep 23, 2016
694f936
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
codedragon Sep 23, 2016
8023413
deleted my screw up
codedragon Sep 23, 2016
19bf430
cleaned out the extra html
PythonCHB Sep 23, 2016
60fc789
changing instructors, again?
codedragon Sep 23, 2016
5bc8ecc
cleaned up intro a bit
PythonCHB Sep 23, 2016
7b7c951
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Sep 23, 2016
79ec378
a few fixes
PythonCHB Sep 25, 2016
239ad20
updateing docs ot point to the resources pages..
PythonCHB Sep 26, 2016
b4ff355
updated and cleaned up Session01
PythonCHB Sep 27, 2016
637291d
put push back in teh build_gh_pages script
PythonCHB Sep 27, 2016
4296ee0
updated scheduling program
PythonCHB Sep 27, 2016
c1ce6a4
updated git overview
codedragon Sep 28, 2016
837bb47
a bit of updating
PythonCHB Sep 28, 2016
d80513a
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Sep 28, 2016
4460558
cleaned out some suppliments
PythonCHB Sep 28, 2016
018d461
made link to resources
codedragon Sep 28, 2016
bc5b38c
got rid of redundant git_overview
codedragon Sep 28, 2016
6b8a7ce
added lightning talk schedule
PythonCHB Sep 28, 2016
85ce298
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Sep 28, 2016
0c66f64
initial changes to git stuff
Oct 1, 2016
bb35be3
got formatting looking decent for slides
Oct 1, 2016
e8bffe9
merging, hope I didn't screw anything completely...
Oct 1, 2016
df97eed
changes "symbol" to "name" everywhere
PythonCHB Oct 2, 2016
e3f9bd1
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Oct 2, 2016
143fc07
cleaned up suppliments -- only unicode in there now -- it it should p…
PythonCHB Oct 2, 2016
8edbd5f
fixed a couple typos
PythonCHB Oct 2, 2016
c13c0bc
a few updates
PythonCHB Oct 5, 2016
8a4ad5a
got rid of two-step pull
codedragon Oct 5, 2016
05febd9
added lightning talks to session 03
PythonCHB Oct 5, 2016
7c2ce65
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Oct 11, 2016
a313e3c
minor updates to session 3
PythonCHB Oct 12, 2016
9a138ca
updated slides a bit
PythonCHB Oct 12, 2016
4dd94e0
added mailroom starting example
PythonCHB Oct 13, 2016
2308dac
updated Syllabus
PythonCHB Oct 13, 2016
84db98a
updated string formatting exercise with more description
PythonCHB Oct 15, 2016
43b64cd
added an example of __main__
PythonCHB Oct 15, 2016
6b6bd38
added a bit more explaination to the fib and lucas exercise
PythonCHB Oct 15, 2016
71d33bb
updated lightning talk people for all sessions
PythonCHB Oct 16, 2016
53eb778
cleaned up mailroom assignemnt and a couple other things.
PythonCHB Oct 19, 2016
4f7fb46
updated homework, etc. for session4
PythonCHB Oct 19, 2016
93e6dcf
a bit of extra explanation.
PythonCHB Oct 24, 2016
e8656f3
updated session 5 -- moved testing to session 6
PythonCHB Oct 26, 2016
6c9ee79
added links to stuff for next week
codedragon Oct 26, 2016
3d4e282
added resources to session 5
PythonCHB Oct 26, 2016
1fde987
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
PythonCHB Oct 26, 2016
abdd608
fixed a remnant of python2 not caught before
codedragon Oct 26, 2016
684aec0
Merge branch 'master' of https://github.com/UWPCE-PythonCert/IntroToP…
codedragon Oct 26, 2016
ddbcc1d
fixed a couple more typos in the dict comps lab
PythonCHB Oct 28, 2016
1c3c660
clarified the set comoprehensions lab a bit
PythonCHB Oct 30, 2016
1acb772
updated presentations..
PythonCHB Nov 1, 2016
bf05ebf
fixed session07 -- but it will need to be trimmed!
PythonCHB Nov 1, 2016
662300e
updated session 6
PythonCHB Nov 2, 2016
addcae8
moved functions to session 9
PythonCHB Nov 11, 2016
802a423
cleaned up html render a bit
PythonCHB Nov 14, 2016
80ad0a1
a little cleanup
PythonCHB Nov 15, 2016
1d2f2a0
removed extra stuff from session 07
PythonCHB Nov 15, 2016
b1e9612
cleaned up session 7
PythonCHB Nov 16, 2016
fcfc2b7
added some notes about indentation to html render exercise.
PythonCHB Nov 19, 2016
438c2af
added note about "class" to html exercise
PythonCHB Nov 20, 2016
60ff915
fixed some typos, etc.
PythonCHB Nov 21, 2016
31b093b
updated session 8 a bit
PythonCHB Nov 21, 2016
1a690fb
update slides for session 8
PythonCHB Nov 23, 2016
8947b52
updated session 8 and 9
PythonCHB Nov 29, 2016
f6cd36b
a bit more cleanup of session 08
PythonCHB Nov 30, 2016
c7513e5
updating session 10 (and a bit of 9)
PythonCHB Dec 7, 2016
a1d2763
a little cleanup
PythonCHB Dec 7, 2016
479f992
pulled Examples back from the fall class repo.
PythonCHB Dec 16, 2016
289133e
added an exercise for an object oriented mailroom.
PythonCHB Jan 3, 2017
b28a30b
typos
Feb 1, 2017
216af3a
fixed it up a bit
PythonCHB Aug 19, 2017
fa2d05d
remove students schedule
PythonCHB Dec 29, 2017
dc0bd22
remove student list
PythonCHB Dec 29, 2017
a959892
fix simple typo
lpmi-13 Aug 10, 2018
62c5f7c
Merge pull request #162 from lpmi-13/typofix
PythonCHB Aug 10, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
slides_sources/build
.idea
.DS_Store
#ignore compiled files, sublime workspace and project files
*.pyc
*junk*

# testing detritus
.cache

#ignore sublime workspace files
*.sublime*

# ignore .gitignore, so we can each have our own.
.gitignore

# editor back-up files
*.*~

# pycache
__pycache__/*
35 changes: 19 additions & 16 deletions Examples/Session01/schedule.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Schedule students for lightning talks, fall 2014
Schedule students for lightning talks, fall 2015
"""
import random

Expand All @@ -8,33 +8,36 @@
# remove the header line
del students[0]

# clean it up a bit:
# strip the whitespace
students = [line.strip() for line in students]

# remove the languages, colon, etc.
students = [line.split(":")[0] for line in students]

# reverse the first, last names

# separate them:
students = [line.split(",") for line in students]

# put them back together
students = [first + last for last, first in students]
students = ["{} {}".format(first.strip(), last) for last, first in students]

# put them in random order
random.shuffle(students)

weeks = range(2,11)

weeks4 = weeks*4
# make a list from 1 to 10
weeks = list(range(2, 11))

schedule = zip(weeks4, students)
# make three of them...
weeks = weeks * 4

schedule.sort()
# put the students together with the weeks
schedule = zip(weeks, students)

outfile = open('schedule.txt', 'w')
# sort it for output
schedule = sorted(schedule)

for week, student in schedule:
line = 'week %s: %s\n' % (week, student)
print line,
outfile.write(line)
outfile.close()
# write it to a file (and print to screen)
with open('schedule.txt', 'w') as outfile:
for week, student in schedule:
line = 'week {}: {}\n'.format(week, student)
print(line)
outfile.write(line)
36 changes: 0 additions & 36 deletions Examples/Session01/students.txt

This file was deleted.

11 changes: 9 additions & 2 deletions Examples/Session01/test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
x = 5
y = 56
y = 55

print x, y
print(x, y)


def f():
x = 5
return x

def f2():
5 + "5"
25 changes: 13 additions & 12 deletions Examples/Session02/codingbat.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

Coding Bat examples
######################
####################

Warmup-1 > monkey_trouble
Warmup-1 > monkey_trouble
============================

We have two monkeys, a and b, and the parameters a_smile and b_smile indicate if each is smiling. We are in trouble if they are both smiling or if neither of them is smiling. Return True if we are in trouble::
Expand All @@ -11,38 +12,38 @@ We have two monkeys, a and b, and the parameters a_smile and b_smile indicate if
monkey_trouble(True, False) → False


Warmup-1 > sleep_in
Warmup-1 > sleep_in
=======================

The parameter weekday is True if it is a weekday, and the parameter vacation is True if we are on vacation. We sleep in if it is not a weekday or we're on vacation. Return True if we sleep in.
The parameter weekday is True if it is a weekday, and the parameter vacation is True if we are on vacation. We sleep in if it is not a weekday or we're on vacation. Return True if we sleep in.

sleep_in(False, False) → True
sleep_in(True, False) → False
sleep_in(False, True) → True


Warmup-1 > diff21
=======================
Warmup-1 > diff21
=================

Given an int n, return the absolute difference between n and 21, except return double the absolute difference if n is over 21.
Given an int n, return the absolute difference between n and 21, except return double the absolute difference if n is over 21.

diff21(19) → 2
diff21(10) → 11
diff21(21) → 0

Warmup-1 > makes10
======================
Warmup-1 > makes10
===================

Given 2 ints, a and b, return True if one if them is 10 or if their sum is 10.
Given 2 ints, a and b, return True if one if them is 10 or if their sum is 10.

makes10(9, 10) → True
makes10(9, 9) → False
makes10(1, 9) → True

Logic-1 > cigar_party
Logic-1 > cigar_party
======================

When squirrels get together for a party, they like to have cigars. A squirrel party is successful when the number of cigars is between 40 and 60, inclusive. Unless it is the weekend, in which case there is no upper bound on the number of cigars. Return True if the party with the given values is successful, or False otherwise.
When squirrels get together for a party, they like to have cigars. A squirrel party is successful when the number of cigars is between 40 and 60, inclusive. Unless it is the weekend, in which case there is no upper bound on the number of cigars. Return True if the party with the given values is successful, or False otherwise.

cigar_party(30, False) → False
cigar_party(50, False) → True
Expand Down
12 changes: 12 additions & 0 deletions Examples/Session02/factorial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin python3

"""
Simple factorial function -- to demostrate recursion
"""


def fact(n):
if n == 0:
return 1
else:
return n * fact(n-1)
42 changes: 42 additions & 0 deletions Examples/Session03/mailroom_start.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env python


def print_report():
print("This will print a report")


def send_thanks():
print("This will write a thank you note")

# here is where triple quoted strings can be helpful
msg = """
What would you like to do?

To send a thank you: type "s"
To print a report: type "p"
To exit: type "x"
"""


def main():
"""
run the main interactive loop
"""

response = ''
# keep asking until the users responds with an 'x'
while True: # make sure there is a break if you have infinite loop!
print(msg)
response = input("==> ").strip() # strip() in case there are any spaces

if response == 'p':
print_report()
elif response == 's':
send_thanks()
elif response == 'x':
break
else:
print('please type "s", "p", or "x"')

if __name__ == "__main__":
main()
12 changes: 12 additions & 0 deletions Examples/Session03/module_reload.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/python

"""
a really simple module to use to test reloading
"""

this = "this2"
that = "that"

def print_something():
print "I'm printing something else"

31 changes: 31 additions & 0 deletions Examples/Session03/slicing_lab.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# slicing lab


def swap(seq):
return seq[-1:]+seq[1:-1]+seq[:1]


assert swap('something') == 'gomethins'
assert swap(tuple(range(10))) == (9,1,2,3,4,5,6,7,8,0)

def rem(seq):
return seq[::2]

assert rem('a word') == 'awr'

def rem4(seq):
return seq[4:-4:2]

print(rem4( (1,2,3,4,5,6,7,8,9,10,11), ) )

def reverse(seq):
return seq[::-1]

print(reverse('a string'))

def thirds(seq):
i = len(seq)//3
#return seq[i*2:i*3+1] + seq[:i] + seq[i:i*2]
return seq[i:-i] + seq[-i:] + seq[:i]

print (thirds(tuple(range(12))))
4 changes: 4 additions & 0 deletions Examples/Session03/test_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env python

print "yes, it ran"

13 changes: 13 additions & 0 deletions Examples/Session04/__main__example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python

print("every module has a __name__")

print("What it is depends on how it is used")

print("right now, this module's __name__ is: {}".format(__name__))

# so if you want coce to run only when a module is a top level script,
# you use this clause:
#if __name__ == "__main__":

print("I must be running as a top-level script")
7 changes: 7 additions & 0 deletions Examples/Session04/format_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def print_me( nums ):
formatter = "the first %d numbers are: " + ", ".join( ["%i"] * len(nums) )
print "formatter: ", formatter
print formatter%(( len(nums), ) + nums)

print_me( (2,3,4,5) )

3 changes: 1 addition & 2 deletions Examples/Session05/arg_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

import sys

print sys.argv

print(sys.argv)
13 changes: 13 additions & 0 deletions Examples/Session05/codingbat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python

"""
Examples from: http://codingbat.com

Put here so we can write unit tests for them ourselves
"""

# Python > Warmup-1 > sleep_in


def sleep_in(weekday, vacation):
return not (weekday and vacation)
25 changes: 25 additions & 0 deletions Examples/Session05/test_codingbat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python

"""
test file for codingbat module

This version can be run with nose or py.test
"""

from codingbat import sleep_in


def test_false_false():
assert sleep_in(False, False)


def test_true_false():
assert not (sleep_in(True, False))


def test_false_true():
assert sleep_in(False, True)


def test_true_true():
assert sleep_in(True, True)
Loading