Python Introduction Workshop: Difference between revisions

From Hackers & Designers
No edit summary
No edit summary
Line 1: Line 1:
== Basics ==
1.) Start python REPL
python
2.) Hello World!
print 'Hello World!'
3.)


What to talk about...
What to talk about...

Revision as of 18:20, 4 February 2016

Basics

1.) Start python REPL

python

2.) Hello World!

print 'Hello World!'

3.)



What to talk about...

  • Variables (integers, arrays)
  • Conditionals (if/elif/else)
  • Loops (for, while)
  • Functions (def function_name(args):)


  • Exception handling? (try/catch)
  • File I/O...reading and writing from files:

f = open('handd-book.wiki', 'w') # write img_file = open(filename, 'wb') # i think append? f = open('handd-book.wiki', 'r') # read