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/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 029e747..0000000 Binary files a/1.9_Mad_Lib/tests/__pycache__/__init__.cpython-37.pyc and /dev/null differ diff --git a/1.9_Mad_Lib/tests/__pycache__/test_zyBooks.cpython-37.pyc b/1.9_Mad_Lib/tests/__pycache__/test_zyBooks.cpython-37.pyc deleted file mode 100644 index 19b4f0e..0000000 Binary files a/1.9_Mad_Lib/tests/__pycache__/test_zyBooks.cpython-37.pyc and /dev/null differ 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)) 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) 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)) 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 diff --git a/1.9_Mad_Lib/mad_lib/__main__.py b/1/1.9 Mad Lib/mad_lib/__main__.py similarity index 100% rename from 1.9_Mad_Lib/mad_lib/__main__.py rename to 1/1.9 Mad Lib/mad_lib/__main__.py 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 83% rename from 1.9_Mad_Lib/mad_lib/mad_lib.py rename to 1/1.9 Mad Lib/mad_lib/mad_lib.py index 8a2b393..321eec3 100644 --- a/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) diff --git a/1.9_Mad_Lib/tests/__init__.py b/1/1.9 Mad Lib/tests/__init__.py similarity index 100% rename from 1.9_Mad_Lib/tests/__init__.py rename to 1/1.9 Mad Lib/tests/__init__.py diff --git a/1.9_Mad_Lib/tests/test_zyBooks.py b/1/1.9 Mad Lib/tests/test_zyBooks.py similarity index 100% rename from 1.9_Mad_Lib/tests/test_zyBooks.py rename to 1/1.9 Mad Lib/tests/test_zyBooks.py diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..e69de29 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