Topics: Core Elements of Programs: strings, input/output, f-strings, operators, branching, indentation
Lecture Notes
Lecture 2: Strings, Input/Output, and Branching
Readings
Ch 2.3–2.4
Finger Exercise Lecture 2
Assume you are given a variable named number (has a numerical value). Write a piece of Python code that prints out one of the following strings:
positiveif the variablenumberis positivenegativeif the variablenumberis negativezeroif the variablenumberis equal to zero
6.100L Finger Exercises Lecture 2 Solutions