Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/Andy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Andy

Github Username:
andy2124

Empty file added code/Andy/python.py
Empty file.
43 changes: 43 additions & 0 deletions code/Andy/python/lab02_unit_converter.py
Original file line number Diff line number Diff line change
@@ -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")