A. Introduction
Declaring variables, taking input, calculating and printing out strings. We are familiar with this step by step sequential processing now. But what if you need to make decisions? For instance, based on a user's description, determine if a shape is a circle, a rectangle, a triangle, a parallelogram, or a trapezoid?
B. Notes
C. HW
Given an integer, print "odd" if it's odd and print "even" otherwise.
Given the two integers, print the least of them. Can you print the least of three numbers?
For the given integer X print 1 if it's positive; -1 if it's negative. Can you print 0 if it's equal to zero?
a = int(input("Enter integer A: ")) if (a % 2 == 0): print("even") else: print("odd") b = int(input("Enter integer B: ")) c = int(input("Enter integer C: ")) if b > c: print (c) elif b < c: print (b) else: print("The two numbers are equal") d = int(input("Enter integer D: ")) e = int(input("Enter integer E: ")) f = int(input("Enter integer F: ")) if d < e and d < f: print (d) elif e < d and e < f: print (e) elif f < d and f < e: print (f) else: print("All three numbers are equal") x = int(input("Enter integer X: ")) if x > 0: print(1) elif x < 0: print(-1) else: print(0)