Lecture Notes on 4 Jun 2019 Learning Python * Write the Hello World program def main(): print ("Hello World!") main() * Characterset: ASCII and Unicode * Variables - must start with a letter - followed by letters, digits, underscores - cannot be a reserved word * Statements and Expressions x = 1 # statement x == 1 # expression * Assignment Statement x = 3.14 * Types - int, float, str, bool * Operators - Arithmetic: + - * / // % ** - Comparison: < <= > >= == != - Boolean: not, and, or - Bitwise: ~ & | ^ - Shift: << >> * Conditionals: if-else, if-elif-else * Loops: while, for while (x < 10): # do something for i in range (10): print (i) * Lists: 1-D, 2-D * Input / Output: Console and Files * Tuple: * Set: * Dictionary: key-value pairs * Functions: built-in, library, user defined * Class Assignments: * Do the following exercises from Coding Bat - Warmup-1 sleep_in monkey_trouble sum_double diff21 parrot_trouble makes10 near_hundred pos_neg - Logic-1 cigar_party date_fashion squirrel_play caught_speeding sorta_sum alarm_clock love6 in1to10 near_ten - Logic-2 make_bricks lone_sum lucky_sum no_teen_sum round_sum close_far make_chocolate