Lecture code 10/27/2026

This commit is contained in:
Edward Bigos 2026-10-27 13:30:41 -04:00
commit aad4e226c5
7 changed files with 152 additions and 0 deletions

View file

@ -0,0 +1,28 @@
print("\nA Program to calculate the area of a rectangle \n")
# Inputs to the program
length = input("Enter a value for the Length ")
length = float(length)
if length <= 0:
print("Length cannot be negative or zero.")
print("Program terminates here\n")
exit()
width = input("Enter a value for the width ")
width = float(width)
if width <= 0:
print("Width cannot be negative or zero.")
print("Program terminates here\n")
exit()
# Calculation or process the data
area = length * width
# Output results
print(f"The area is {area}")