CSCI 1105 Lecture 6: Decisions - 20 Sep 2018
CSCI 1105 verified notes
6/25View all
Document Summary
20 sep 2018 lec #6 decisions. Allows a program to carry out different actions depending on the nature of the data to be processed (dr siegel, powerpoint, slide 5) Lots of python construction are compound statements. Consist of a header and a statement block. Must have a colon : at the end of the header. Start on the line after the header and ends at the first statement indented less than the first statement in the block. (dr siegel, powerpoint, slide 16) Compares two values with an operator ( >, =, ==) Comparison operators are lower than arithmetic operators. Calculation are on the right side of the comparison or assignment operator. Make something true - assignment (house = 10) different from check if something is true. Equality testing (house == 10) (dr siegel, powerpoint, slide 30) You cannot compare a string to a number. (dr siegel, powerpoint, slide 34)