Skip to content

Commit 287703d

Browse files
authored
Merge pull request #29 from PdxCodeGuild/andy-lab-unit-converter2
Andy lab unit converter2
2 parents 3c5210c + f4393e5 commit 287703d

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

code/Andy/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ Andy
44

55
Github Username:
66
andy2124
7+

code/Andy/python.py

Whitespace-only changes.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#version 1
2+
units = {
3+
"feet": 0.3048,
4+
"meters": 1
5+
}
6+
distance = input("Enter Lenth of feet:")
7+
distance= int(distance)
8+
total = distance * units["feet"]
9+
print(f"{distance} FT is {total} Meters")
10+
11+
#version 2
12+
units_mesurments = {
13+
"feet": 0.3048,
14+
"miles": 1609.34,
15+
"meters": 1,
16+
"kilometers": 1000
17+
}
18+
19+
distance = input("what is the distance?")
20+
units = input("what are the units?:")
21+
calling = units_mesurments[units]
22+
distance = int(distance)
23+
total = distance * calling
24+
25+
print(f"{distance} {units} is {total} Meters")
26+
27+
#version 3
28+
units_mesurments = {
29+
"feet": 0.3048,
30+
"miles": 1609.34,
31+
"meters": 1,
32+
"kilometers": 1000,
33+
"yards": 0.9144,
34+
"inches": 0.0254
35+
}
36+
37+
distance = input("what is the distance?")
38+
units = input("what are the units?:")
39+
calling = units_mesurments[units]
40+
distance = int(distance)
41+
total = distance * calling
42+
43+
print(f"{distance} {units} is {total} Meters")

0 commit comments

Comments
 (0)