INFO1110 Lecture Notes - Lecture 3: Control Flow, Boolean Expression, Gnu Readline
Document Summary
Control low and ile i/o if elif else statements. Allows the program to execute different code based on a condition (a control statement), a boolean expression that evaluates to true or false. if : A table used to track each variable and how they change. When used in testing, pick values that are normal, abnormal, or on the boundaries. while loops. Repeat a section of code while the condition is true. while : Repeating something in a systematic way. break and continue break. When used in loops, it means break from the current iteration of this loop or exits the loop. continue. When used in loops, it means skip the rest of this iteration and continue to the next one. # using break while true: line = input() if len(line) == 0: break. # checking length of line as the condition line = input() while len(line) != 0: line = input()