Python W4
# You must add comments to your code # Program name : Wk4_Jerimiah_Ginn.py # Student Name : Jerimiah Ginn # Course : ENTD220 # Instructor : Michael Tomcho # Date : 26 October 2021 # Copy Wrong : This is my work def is_in_range(lr, hr, n): return n >= lr and n <= hr def add(n1, n2): return n1+n2 def sub(n1, n2): return n1-n2 def mult(n1, n2): return n1*n2 def div(n1, n2): return n1/n2 while 1: lr = float(input('Enter your Lower range ---> ')) hr = float(input('Enter your Higher range ---> ')) n1 = float(input('Enter your First number ---> ')) n2 = float(input('Enter your Second number ---> ')) if not (is_in_range(lr, hr, n1) and is_in_range(lr, hr, n2)): print('The input values are out side the input ranges') print('Please check the numbers and try again') break print('The Result of ', n1, '+', n2, '=', add(n1, n2)) print('The Result of ', n1, '-', n2, '=', sub(n1, n2)) print('The Result of ', n1, '*', n2, '=', mult(n1, n2)) print('The Result of ', n1, '/', n2, '=', div(n1, n2)) rep = input('Continue Looping Y/N ') if rep == 'N' or rep == 'n': break print('Thanks for using our calculator')