From 2555bc240032ef1c175c41f7397a313422f4897e Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Fri, 8 Jan 2021 20:39:15 -0500 Subject: [PATCH 01/10] Add files for git --- .gitignore | 2 ++ readme.md | 0 2 files changed, 2 insertions(+) create mode 100644 .gitignore create mode 100644 readme.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fd20fdd --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +*.pyc diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..e69de29 From 30619cf6226283c36649a803e522e74f3426bbc1 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Fri, 8 Jan 2021 20:39:28 -0500 Subject: [PATCH 02/10] Remove unused --- 1.9_Mad_Lib/mad_lib/__main__.py | 0 1.9_Mad_Lib/tests/__init__.py | 0 test.py | 6 ------ 3 files changed, 6 deletions(-) delete mode 100644 1.9_Mad_Lib/mad_lib/__main__.py delete mode 100644 1.9_Mad_Lib/tests/__init__.py delete mode 100644 test.py diff --git a/1.9_Mad_Lib/mad_lib/__main__.py b/1.9_Mad_Lib/mad_lib/__main__.py deleted file mode 100644 index e69de29..0000000 diff --git a/1.9_Mad_Lib/tests/__init__.py b/1.9_Mad_Lib/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/test.py b/test.py deleted file mode 100644 index f94b601..0000000 --- a/test.py +++ /dev/null @@ -1,6 +0,0 @@ -a = 3 -x = 4 -y = a * x -y = y + 7 - -print (x, y) \ No newline at end of file From 82e01a0f5fcd836285c5fc2b4c1fd92bd931a210 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Fri, 8 Jan 2021 20:39:40 -0500 Subject: [PATCH 03/10] Ignore pyc --- .../tests/__pycache__/__init__.cpython-37.pyc | Bin 192 -> 0 bytes .../tests/__pycache__/test_zyBooks.cpython-37.pyc | Bin 757 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 1.9_Mad_Lib/tests/__pycache__/__init__.cpython-37.pyc delete mode 100644 1.9_Mad_Lib/tests/__pycache__/test_zyBooks.cpython-37.pyc diff --git a/1.9_Mad_Lib/tests/__pycache__/__init__.cpython-37.pyc b/1.9_Mad_Lib/tests/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index 029e747036a1e342b7062e59191d97de278d558a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 192 zcmZ?b<>g`kf(Z#<<3aRe5CH>>K!yVl7qb9~6oz01O-8?!3`HPe1o11=#VW=*KPM+O zJvAoS&m%O(IVZ8WIJG#&GepY`>ZJ^BDYm;m1dT0Yj97{xD zB@*X^61=ZD)Om}z!`(Z?U4g#3TZekW=iZ8_D}nA?56IrcQxy4+76(lt+;~-D(q#(U zgZVbOwyvMsAP~hIQ6e0UIRS9)EnM#ZB)r9gJG8~rK?qfWXfS}`>*?Ir+#rfxp!R4TPQy5k9IyG5YbWPcv zrYfr}#YK0}AAh=ttF>8{McnVbWFPDx@3VPqtQ2||*?)C<)w&6xd?=g(J>ZFmPd3kv zMeH5ln?zm{FjgeFV615~mfKk*F|M_IQ+7g#k^4P;&v`s2Rwrpkouf-Vb_ZKQ+=&3UG)6 I=PV5HKaX|59RL6T From 8b5453fa26eb81938dccae86654a08cd7e2516e7 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Fri, 8 Jan 2021 20:39:59 -0500 Subject: [PATCH 04/10] rename mad_lib --- 1/1.9 Mad Lib/mad_lib/__main__.py | 0 .../1.9 Mad Lib}/mad_lib/mad_lib.py | 0 1/1.9 Mad Lib/tests/__init__.py | 0 1/1.9 Mad Lib/tests/test_zyBooks.py | 19 +++++++++++++++++++ 4 files changed, 19 insertions(+) create mode 100644 1/1.9 Mad Lib/mad_lib/__main__.py rename {1.9_Mad_Lib => 1/1.9 Mad Lib}/mad_lib/mad_lib.py (100%) create mode 100644 1/1.9 Mad Lib/tests/__init__.py create mode 100644 1/1.9 Mad Lib/tests/test_zyBooks.py diff --git a/1/1.9 Mad Lib/mad_lib/__main__.py b/1/1.9 Mad Lib/mad_lib/__main__.py new file mode 100644 index 0000000..e69de29 diff --git a/1.9_Mad_Lib/mad_lib/mad_lib.py b/1/1.9 Mad Lib/mad_lib/mad_lib.py similarity index 100% rename from 1.9_Mad_Lib/mad_lib/mad_lib.py rename to 1/1.9 Mad Lib/mad_lib/mad_lib.py diff --git a/1/1.9 Mad Lib/tests/__init__.py b/1/1.9 Mad Lib/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/1/1.9 Mad Lib/tests/test_zyBooks.py b/1/1.9 Mad Lib/tests/test_zyBooks.py new file mode 100644 index 0000000..6a73dbd --- /dev/null +++ b/1/1.9 Mad Lib/tests/test_zyBooks.py @@ -0,0 +1,19 @@ +import unittest +from unittest.mock import patch +import mad_lib + + +class zyBooks_Test(unittest.TestCase): + + + + + @patch('builtins.input', return_value=['Eric', 'Chipotle', '12', 'cars']) + def test_zyBooks(self, mock_input): + result = mad_lib() + + self.assertEqual(result, 6) + + +if __name__ == '__main__': + unittest.main() From e9b5aae5283b2b88548101bbb0ef05c92bbe2358 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Fri, 8 Jan 2021 20:40:10 -0500 Subject: [PATCH 05/10] delete zybooks test --- 1.9_Mad_Lib/tests/test_zyBooks.py | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 1.9_Mad_Lib/tests/test_zyBooks.py diff --git a/1.9_Mad_Lib/tests/test_zyBooks.py b/1.9_Mad_Lib/tests/test_zyBooks.py deleted file mode 100644 index 6a73dbd..0000000 --- a/1.9_Mad_Lib/tests/test_zyBooks.py +++ /dev/null @@ -1,19 +0,0 @@ -import unittest -from unittest.mock import patch -import mad_lib - - -class zyBooks_Test(unittest.TestCase): - - - - - @patch('builtins.input', return_value=['Eric', 'Chipotle', '12', 'cars']) - def test_zyBooks(self, mock_input): - result = mad_lib() - - self.assertEqual(result, 6) - - -if __name__ == '__main__': - unittest.main() From 8e5f9597bc99f288b7bd31a40a45739ce767265f Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Fri, 8 Jan 2021 20:40:15 -0500 Subject: [PATCH 06/10] Add 1.10 --- 1/1.10 Lab Warm Up/warm_up/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 1/1.10 Lab Warm Up/warm_up/main.py diff --git a/1/1.10 Lab Warm Up/warm_up/main.py b/1/1.10 Lab Warm Up/warm_up/main.py new file mode 100644 index 0000000..562ad05 --- /dev/null +++ b/1/1.10 Lab Warm Up/warm_up/main.py @@ -0,0 +1,9 @@ +if __name__ == '__main__': + num1 = int(input('Enter integer:\n')) + + print('You entered: {0}'.format(num1)) + print('{0} squared is {1}'.format(num1, num1 ** 2)) + print('And {0} cubed is {1} !!'.format(num1, num1 ** 3)) + num2 = int(input('Enter another integer:\n')) + print('{0} + {1} is {2}'.format(num1, num2, num1 + num2)) + print('{0} * {1} is {2}'.format(num1, num2, num1 * num2)) From 7ee4f04a184ed869b0212f753f8068a1aa23852c Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Fri, 8 Jan 2021 20:40:23 -0500 Subject: [PATCH 07/10] Add 1.21 --- 1/1.21 Divide By X/divide_by/main.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 1/1.21 Divide By X/divide_by/main.py diff --git a/1/1.21 Divide By X/divide_by/main.py b/1/1.21 Divide By X/divide_by/main.py new file mode 100644 index 0000000..3c382c7 --- /dev/null +++ b/1/1.21 Divide By X/divide_by/main.py @@ -0,0 +1,13 @@ +if __name__ == '__main__': + user_num = int(input()) + x = int(input()) + + result = [] + + for i in range(3): + if i == 0: + result.append(int(user_num / x)) + else: + result.append(int(result[i - 1] / x)) + + print(*result) From 40a9e4776cfa8e0c268978aeba49144e5ca19c5e Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Fri, 8 Jan 2021 20:40:29 -0500 Subject: [PATCH 08/10] Add 1.22 --- 1/1.22 Calories Burned/calories/main.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 1/1.22 Calories Burned/calories/main.py diff --git a/1/1.22 Calories Burned/calories/main.py b/1/1.22 Calories Burned/calories/main.py new file mode 100644 index 0000000..d334cc4 --- /dev/null +++ b/1/1.22 Calories Burned/calories/main.py @@ -0,0 +1,11 @@ +''' Women: Calories = ((Age x 0.074) - (Weight x 0.05741) + (Heart Rate x 0.4472) - 20.4022) x Time / 4.184 ''' +''' Men: Calories = ((Age x 0.2017) + (Weight x 0.09036) + (Heart Rate x 0.6309) - 55.0969) x Time / 4.184 ''' + +''' Type your code here. ''' + +age = float(input()) +weight = float(input()) +bpm = float(input()) +time = float(input()) + +print('Women: {0:.2f} calories\nMen: {1:.2f} calories'.format(((age * 0.074) - (weight * 0.05741) + (bpm * 0.4472) - 20.4022) * time / 4.184, ((age * 0.2017) + (weight * 0.09036) + (bpm * 0.6309) - 55.0969) * time / 4.184)) From affefca9a6f55a65d1c18c6ffd004747ca0170b4 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Fri, 8 Jan 2021 20:40:37 -0500 Subject: [PATCH 09/10] Add 1.23 --- 1/{23 => 1.23 Lab Warm Up/warm_up}/main.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 1/{23 => 1.23 Lab Warm Up/warm_up}/main.py (100%) diff --git a/1/23/main.py b/1/1.23 Lab Warm Up/warm_up/main.py similarity index 100% rename from 1/23/main.py rename to 1/1.23 Lab Warm Up/warm_up/main.py From 0b457c6c882ce1336d6336e7fb98d84a59cb378f Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Fri, 8 Jan 2021 21:04:11 -0500 Subject: [PATCH 10/10] Update mad_lib.py --- 1/1.9 Mad Lib/mad_lib/mad_lib.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/1/1.9 Mad Lib/mad_lib/mad_lib.py b/1/1.9 Mad Lib/mad_lib/mad_lib.py index 8a2b393..321eec3 100644 --- a/1/1.9 Mad Lib/mad_lib/mad_lib.py +++ b/1/1.9 Mad Lib/mad_lib/mad_lib.py @@ -2,8 +2,12 @@ # Construct a mad lib class mad_lib: + # Initalize a constructor for python mad lib def __init__(self, lib): + # lib is a value passed in during the construction of this class self.text = lib + + # Replace %text% with user input self.text = self.text.replace('%first_name%', self.first_name()) self.text = self.text.replace('%location%', self.location()) self.text = self.text.replace('%whole_number%', self.whole_number()) @@ -30,4 +34,4 @@ class mad_lib: # Construct a mad lib md = mad_lib('%first_name% went to %location% to buy %whole_number% different types of %plural_noun%') -print(md.text) \ No newline at end of file +print(md.text)