Lecture Notes on 27 Jan 2014 * Review number conversions - decimal to binary, octal, and hexadecimal and vice versa - binary to octal, decimal, and hexadecimal and vice versa - octal to hexadecimal and vice versa * Learn the Structure of Python - Write the 'Hello World' program - Characterset - ASCII and Unicode - Variables - Types - numbers, booleans, and strings - Operators - Arithmetic: + - * / // % ** - Comparison: < <= > >= == != - Boolean: not, and, or - Bitwise: ~ & | ^ - Shift: << >> - Expressions and Statements - Conditionals: if-else, if-elif-else - Loops: while, for - Functions: - Input / Output: Console and File - Lists - Tuples, Sets, and Dictionaries - Class * Characterset is ASCII (American Standard Code for Information Interchange) - 7 bit binary padded with a 0 to the left to make 1 byte 0 = 0011 0000 A = 0100 0001 a = 0110 0001 * Unicode is 16 bits, ASCII characters occupy the lower 8 bits. In Python Greek lower case alpha will be represented as '\u03B1'. * Create meaningful short variable names. Use letters to begin your variable names and separate two or more words in a variable name by underscores. * Implicit types in Python - numbers, booleans, and strings * Numbers - integers and floating points numbers. Integer representation is exact and so is the arithmetic. Floating point representation is inexact and there are round off errors in computations. * Boolean types are either True or False. 0 (zero) and '' (empty string) are also taken to be False. Any other number or string is taken to be True. * String is either in single quotes ('') or double quotes (""). A character is a string of unit length.