From 41e732fa9eeb8533342662ec561553257a95e001 Mon Sep 17 00:00:00 2001 From: andy2124 Date: Thu, 30 Jun 2022 16:51:49 -0700 Subject: [PATCH 1/4] adding lab 1 --- code/Andy/README.md | 1 + code/Andy/python.py | 0 code/Andy/python/lab01-average_number.py | 9 +++++++++ 3 files changed, 10 insertions(+) create mode 100644 code/Andy/python.py create mode 100644 code/Andy/python/lab01-average_number.py 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/lab01-average_number.py b/code/Andy/python/lab01-average_number.py new file mode 100644 index 00000000..b18131dd --- /dev/null +++ b/code/Andy/python/lab01-average_number.py @@ -0,0 +1,9 @@ +nums = [5, 0, 8, 3, 4, 1, 6] + +total = 0 + +for num in nums: + total = total + num + +average = total/(len(nums)) +print(average) \ No newline at end of file From 524e7578127e01bca29d75280ff307406975c9dc Mon Sep 17 00:00:00 2001 From: andy2124 Date: Thu, 30 Jun 2022 19:48:49 -0700 Subject: [PATCH 2/4] adding lab 2 --- code/Andy/python/lab02_unit_converter.py | 43 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 code/Andy/python/lab02_unit_converter.py diff --git a/code/Andy/python/lab02_unit_converter.py b/code/Andy/python/lab02_unit_converter.py new file mode 100644 index 00000000..e0c506ab --- /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") From 4a7a9bafec3e08efce828eaf770cde386aeb13d9 Mon Sep 17 00:00:00 2001 From: andy2124 Date: Tue, 5 Jul 2022 21:10:00 -0700 Subject: [PATCH 3/4] lab 2 unit converter finished --- code/Andy/python/lab02_unit_converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Andy/python/lab02_unit_converter.py b/code/Andy/python/lab02_unit_converter.py index e0c506ab..ed2e9344 100644 --- a/code/Andy/python/lab02_unit_converter.py +++ b/code/Andy/python/lab02_unit_converter.py @@ -40,4 +40,4 @@ distance = int(distance) total = distance * calling -print(f"{distance} {units} is {total} Meters") +print(f"{distance} {units} is {total} Meters") \ No newline at end of file From f4393e533a23c58f84bc8fae4803c38eec166ce3 Mon Sep 17 00:00:00 2001 From: andy2124 Date: Tue, 5 Jul 2022 21:28:06 -0700 Subject: [PATCH 4/4] removed lab 1 --- code/Andy/python/lab01-average_number.py | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 code/Andy/python/lab01-average_number.py diff --git a/code/Andy/python/lab01-average_number.py b/code/Andy/python/lab01-average_number.py deleted file mode 100644 index b18131dd..00000000 --- a/code/Andy/python/lab01-average_number.py +++ /dev/null @@ -1,9 +0,0 @@ -nums = [5, 0, 8, 3, 4, 1, 6] - -total = 0 - -for num in nums: - total = total + num - -average = total/(len(nums)) -print(average) \ No newline at end of file