'''lecture_09_distance_template.py Illustrates how return statements work Oliver W. Layton CS 151: Computational Thinking: Visual Media Spring 2021 TODO: 1. Add return statement 2. Demo None: show what happens with assignment without return value 3. Simultaneous assignment: show returning absolute and Eucludean distance 4. Try adding int and tuple ''' import math def distance(x, y): '''Computes the Euclidean distance between x and y''' dist = math.sqrt(x**2 + y**2) # 5 # return dist # return 5 # return math.sqrt(x**2 + y**2) # return 5 # return # main code # dist = 0 x = 3 y = 4 # distance(x, y) # 5 # 5 # dist = distance(x, y) # 5 # This is like: dist = 5 z = distance(x, y) # z = 5 # print(dist) print(z) if z is None: print('We have a None!') else: print('We have a distance value!')