Skip to content

Commit

Permalink
Up through Chapter 3
Browse files Browse the repository at this point in the history
  • Loading branch information
csev committed Aug 14, 2016
1 parent 7846cb3 commit 5eb0622
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code3/notry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
astr = 'Hello Bob'
istr = int(astr)
print('First', istr)
astr = '123'
istr = int(astr)
print('Second', istr)
16 changes: 16 additions & 0 deletions code3/tryexcept.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
astr = 'Hello Bob'
try:
istr = int(astr)
except:
istr = -1

print('First', istr)

astr = '123'
try:
istr = int(astr)
except:
istr = -1

print('Second', istr)

11 changes: 11 additions & 0 deletions code3/trynum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
rawstr = input('Enter a number:')
try:
ival = int(rawstr)
except:
ival = -1

if ival > 0 :
print('Nice work')
else:
print('Not a number')

Binary file modified lectures3/Pythonlearn-01-Intro.pptx
Binary file not shown.
Binary file modified lectures3/Pythonlearn-02-Expressions.pptx
Binary file not shown.
Binary file modified lectures3/Pythonlearn-03-Conditional.pptx
Binary file not shown.

0 comments on commit 5eb0622

Please sign in to comment.