Skip to content

Latest commit

 

History

History
79 lines (61 loc) · 1.5 KB

File metadata and controls

79 lines (61 loc) · 1.5 KB

Goals of this class

  • How to take take a programming class
  • How to mentor others to help them learn how to program
  • Free & open materials , everything here is free to share

###Chapter 1 Why Program?/ Hardware Basics/About Python

*python has reserved words:

  • AND
  • DEL
  • FOR
  • IS
  • RAISE
  • BREAK
  • ASSERT
  • ELIF
  • FROM
  • LAMBDA
  • RETURN
  • ELSE
  • GLOBAL
  • NOT
  • TRY
  • CLASS
  • EXCEPT
  • IF
  • OR
  • WHILE
  • CONTINUE
  • EXEC
  • IMPORT
  • PASS
  • YIELD
  • DEF
  • FINALLY
  • IN
  • PRINT

Chapter 2 Variables and Expressions

  • /** power of operator 4**3
  • integer division truncates 9/2 yields 4 ( unless you make it a float)

Chapter 2.2 Types

  • traceback is a py error. python's way of saying "i'm lost, i don't understand what you're trying to do."
  • type() will tell you the type of a variable
  • raw_input() built in function, takes a string, issues a prompt, waits for input, converts input to a string
  • use "#" to comment in python

Chapter 3.1 Conditional Execution

  • < less than

  • < = less than or equal to

  • greater than

  • = greater than or equal to

  • == equal to

  • != not equal to

  • INDENTATION IS SUPER DUPER IMPORTANT IN PYTHON

Chapter 3.2 Examples of Conditional Statements

  • if x<2: print small elif x< 10: print medium else: print large

Chapter 3.3 Try and Except

  • used to protect from dangerous code
  • try to have as little in "try" as possible, so you know what has failed when you get an error msg in your code.