- 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
- /** power of operator 4**3
- integer division truncates 9/2 yields 4 ( unless you make it a float)
- 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
-
< 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
- if x<2: print small elif x< 10: print medium else: print large
- 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.