Added Homework 04 - Strings

This commit is contained in:
Edward Bigos 2026-11-03 10:54:55 -05:00
commit be356ccb59
24 changed files with 315 additions and 0 deletions

View file

@ -0,0 +1,5 @@
data1 = input("Enter a value for data1: ")
print(f"data1 = {data1}, The type of data1 is {type(data1)}")

View file

@ -0,0 +1,8 @@
print("This program converts the input to an integer\n")
data1 = input("Enter an integer value for data1: ")
print(f"The type of data1 is {type(data1)} at input")
data1 = int(data1)
print(f"The type of data1 is {type(data1)} after conversion to int")
print(f"The value of data1 is {data1}")

View file

@ -0,0 +1,8 @@
print("This program converts the input to a float\n")
data1 = input("Enter an float value for data1: ")
print(f"The type of data1 is {type(data1)} at input")
data1 = float(data1)
print(f"The type of data1 is {type(data1)} after conversion to float")
print(f"The value of data1 is {data1}")

View file

@ -0,0 +1,8 @@
length = 4
width = 3
area = length * width
print(f"The area is {area}")

View file

@ -0,0 +1,7 @@
length = float(input("Enter a value for the length: "))
width = float(input("Enter a value for the width: "))
area = length * width
print(f"The area is {area}")