Skip to content

Commit 222edf4

Browse files
authored
Merge pull request #54 from PdxCodeGuild/jonpan-lab02-unit-converter
resubmitting lab02
2 parents 021e962 + 1d66f75 commit 222edf4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

code/jonpan/lab02.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,23 @@
2121
# 'yard': 0.9144,
2222
# 'inch': 0.0254,
2323
# }
24+
2425
# selectedunit = conversion[units]
2526
# result = selectedunit * int(distance)
2627

27-
# print(f"\n{distance} ft is {result} m")
28-
2928
## VERSION 4 BELOW
3029

3130
distance = input("\nWhat is the distance? ")
32-
input_units = input("\nWhat are the input units? Your choices are feet, miles, meters, or km. ")
33-
output_units = input("\nWhat are the output units? Your choices are feet, miles, meters, or km. ")
31+
input_units = input("\nWhat are the input units? Your choices are feet, miles, meters, km, yard, or inch. ")
32+
output_units = input("\nWhat are the output units? Your choices are feet, miles, meters, km, yard, or inch. ")
3433

3534
conversion = {
3635
'feet': 0.3048,
3736
'miles': 1609.34,
3837
'meters': 1,
3938
'km': 1000,
39+
'yard': 0.9144,
40+
'inch': 0.0254,
4041
}
4142

4243
inputresults = conversion[input_units]

0 commit comments

Comments
 (0)