From 46a9519262ab134af7704c0b48a0ddc0e216b1a5 Mon Sep 17 00:00:00 2001 From: asefrind <75707841+asefrind@users.noreply.github.com> Date: Thu, 25 Feb 2021 14:55:47 -0300 Subject: [PATCH 1/4] Add files via upload --- math/raiseToThePower.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 math/raiseToThePower.py diff --git a/math/raiseToThePower.py b/math/raiseToThePower.py new file mode 100644 index 0000000..90bee3c --- /dev/null +++ b/math/raiseToThePower.py @@ -0,0 +1,22 @@ +# We're going to creating a function to calculate the power of a number, instead of using the pow(x, x) function +# so we can understand a bit more about programming logic + +# Defining function and giving its parameters to store the values we give it +def raise_to_power(base_num, pow_num): + result = 1 # Here, we're defining a variable to store the result of the calculation that will happen later in the function + + # We are going to use this loop to multiply the base number that we're to define, + # an X amount of times (the amount of times of the power value) + + for i in range(pow_num): + result = result * base_num # In the variable 'result' we are going to store the finished calculation + + return result # We return result so we dont get a None value from the function + +"You can replace these values and run the program" +print(raise_to_power(6, 4)) # We define the base and power number, first value is going to be the base and + # 2nd is the power we're going to elevate it to. it can be an integer and/or float number + +# This is the same as writing pow(6, 4), therefore 6 to the power of 4 + + From ea206a0355520b3153823ef21604ba4f72e3e3c2 Mon Sep 17 00:00:00 2001 From: asefrind <75707841+asefrind@users.noreply.github.com> Date: Thu, 25 Feb 2021 14:56:24 -0300 Subject: [PATCH 2/4] Delete raiseToThePower.py --- math/raiseToThePower.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 math/raiseToThePower.py diff --git a/math/raiseToThePower.py b/math/raiseToThePower.py deleted file mode 100644 index 90bee3c..0000000 --- a/math/raiseToThePower.py +++ /dev/null @@ -1,22 +0,0 @@ -# We're going to creating a function to calculate the power of a number, instead of using the pow(x, x) function -# so we can understand a bit more about programming logic - -# Defining function and giving its parameters to store the values we give it -def raise_to_power(base_num, pow_num): - result = 1 # Here, we're defining a variable to store the result of the calculation that will happen later in the function - - # We are going to use this loop to multiply the base number that we're to define, - # an X amount of times (the amount of times of the power value) - - for i in range(pow_num): - result = result * base_num # In the variable 'result' we are going to store the finished calculation - - return result # We return result so we dont get a None value from the function - -"You can replace these values and run the program" -print(raise_to_power(6, 4)) # We define the base and power number, first value is going to be the base and - # 2nd is the power we're going to elevate it to. it can be an integer and/or float number - -# This is the same as writing pow(6, 4), therefore 6 to the power of 4 - - From 03648d134335b3f32c00470090c8dd6123a37b32 Mon Sep 17 00:00:00 2001 From: asefrind <75707841+asefrind@users.noreply.github.com> Date: Thu, 25 Feb 2021 14:57:03 -0300 Subject: [PATCH 3/4] Add files via upload --- math/raiseToThePower.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 math/raiseToThePower.py diff --git a/math/raiseToThePower.py b/math/raiseToThePower.py new file mode 100644 index 0000000..90bee3c --- /dev/null +++ b/math/raiseToThePower.py @@ -0,0 +1,22 @@ +# We're going to creating a function to calculate the power of a number, instead of using the pow(x, x) function +# so we can understand a bit more about programming logic + +# Defining function and giving its parameters to store the values we give it +def raise_to_power(base_num, pow_num): + result = 1 # Here, we're defining a variable to store the result of the calculation that will happen later in the function + + # We are going to use this loop to multiply the base number that we're to define, + # an X amount of times (the amount of times of the power value) + + for i in range(pow_num): + result = result * base_num # In the variable 'result' we are going to store the finished calculation + + return result # We return result so we dont get a None value from the function + +"You can replace these values and run the program" +print(raise_to_power(6, 4)) # We define the base and power number, first value is going to be the base and + # 2nd is the power we're going to elevate it to. it can be an integer and/or float number + +# This is the same as writing pow(6, 4), therefore 6 to the power of 4 + + From 3da5251c32bed03fa5782ba0e805e34d90c4dbd3 Mon Sep 17 00:00:00 2001 From: asefrind <75707841+asefrind@users.noreply.github.com> Date: Fri, 26 Feb 2021 23:39:13 -0300 Subject: [PATCH 4/4] Update multiplicationTables.py --- multiplicationTables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multiplicationTables.py b/multiplicationTables.py index ab9085f..e64731e 100644 --- a/multiplicationTables.py +++ b/multiplicationTables.py @@ -2,7 +2,7 @@ while True: startOrEnd = str(input('Start or End : ')) - if startOrEnd == 'Start': + if startOrEnd == 'Start' or 'start': whichTable = int(input('Which Table : ')) for x in range(1, 13): table = whichTable * x