diff --git a/code/Andy/README.md b/code/Andy/README.md index 47c4a470..cce7e451 100644 --- a/code/Andy/README.md +++ b/code/Andy/README.md @@ -4,3 +4,4 @@ Andy Github Username: andy2124 + diff --git a/code/Andy/python.py b/code/Andy/python.py new file mode 100644 index 00000000..e69de29b diff --git a/code/Andy/python/lab02_unit_converter.py b/code/Andy/python/lab02_unit_converter.py new file mode 100644 index 00000000..ed2e9344 --- /dev/null +++ b/code/Andy/python/lab02_unit_converter.py @@ -0,0 +1,43 @@ +#version 1 +units = { + "feet": 0.3048, + "meters": 1 +} +distance = input("Enter Lenth of feet:") +distance= int(distance) +total = distance * units["feet"] +print(f"{distance} FT is {total} Meters") + +#version 2 +units_mesurments = { + "feet": 0.3048, + "miles": 1609.34, + "meters": 1, + "kilometers": 1000 + } + +distance = input("what is the distance?") +units = input("what are the units?:") +calling = units_mesurments[units] +distance = int(distance) +total = distance * calling + +print(f"{distance} {units} is {total} Meters") + +#version 3 +units_mesurments = { + "feet": 0.3048, + "miles": 1609.34, + "meters": 1, + "kilometers": 1000, + "yards": 0.9144, + "inches": 0.0254 + } + +distance = input("what is the distance?") +units = input("what are the units?:") +calling = units_mesurments[units] +distance = int(distance) +total = distance * calling + +print(f"{distance} {units} is {total} Meters") \ No newline at end of file