From 5b085f5dd1cf48d3b73a9dbfa27260752cd197e1 Mon Sep 17 00:00:00 2001 From: eo4wellness Date: Thu, 14 Oct 2021 11:41:21 -0500 Subject: [PATCH 01/10] Create simple-password-utility.py --- Python/simple-password-utility.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Python/simple-password-utility.py diff --git a/Python/simple-password-utility.py b/Python/simple-password-utility.py new file mode 100644 index 0000000..7eca146 --- /dev/null +++ b/Python/simple-password-utility.py @@ -0,0 +1,5 @@ +import string +from random import * +characters = string.ascii_letters + string.punctuation + string.digits +password = "".join(choice(characters) for x in range(randint(8, 16))) +print ("Your new randomly generated password is: " + password) \ No newline at end of file From 6f61106442a25a9c00de8ac99923a4e74328df14 Mon Sep 17 00:00:00 2001 From: eo4wellness Date: Thu, 14 Oct 2021 11:51:42 -0500 Subject: [PATCH 02/10] Update simple-password-utility.py --- Python/simple-password-utility.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/simple-password-utility.py b/Python/simple-password-utility.py index 7eca146..0e80e19 100644 --- a/Python/simple-password-utility.py +++ b/Python/simple-password-utility.py @@ -1,3 +1,4 @@ +# hacktoberfest 2021 import string from random import * characters = string.ascii_letters + string.punctuation + string.digits From fed8588b7b050209e86405e8198b3cdeeba32f77 Mon Sep 17 00:00:00 2001 From: eo4wellness Date: Thu, 14 Oct 2021 12:11:44 -0500 Subject: [PATCH 03/10] Create Exponentiation.py --- Python/Exponentiation.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Python/Exponentiation.py diff --git a/Python/Exponentiation.py b/Python/Exponentiation.py new file mode 100644 index 0000000..ba61fdd --- /dev/null +++ b/Python/Exponentiation.py @@ -0,0 +1,15 @@ +# hacktoberfest 2021 +# Exponentiation +# Exponentiation is the raising of one number to the power of another. +# This operation is performed using two asterisks **. +# Let's use exponentiation to solve a known problem. +# You are offered a choice of either $1.000.000 or $0.01 (one penny) doubled every day for 30 days (the resulting amount is doubled every day). +# +# Task: +# Write a program to calculate the amount that will result from the doubling to understand which choice results in a larger amount. +# +#Hint: +# Let's see how exponentiation can be useful to perform the calculation. +# For example, if we want to calculate how much money we will have on the 5th day, we can use this expression: 0.01*(2**5) = 0.32 dollars (multiply the penny by 2 raised to the power of 5). +# Use the print statement to output the resulting amount. +print (0.01 *(2 **30)) \ No newline at end of file From f8a496052c6da5003146c069519f622eadf7d611 Mon Sep 17 00:00:00 2001 From: eo4wellness Date: Thu, 14 Oct 2021 12:27:50 -0500 Subject: [PATCH 04/10] Create simple-number-guessing-game.py --- Python/simple-number-guessing-game.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Python/simple-number-guessing-game.py diff --git a/Python/simple-number-guessing-game.py b/Python/simple-number-guessing-game.py new file mode 100644 index 0000000..64291f3 --- /dev/null +++ b/Python/simple-number-guessing-game.py @@ -0,0 +1,24 @@ +# Hacktoberfest 2021 + +import random +number=random.randrange(0,100) +checkGuess="wrong" +print("Welcome to a Number Guessing Game") + +while checkGuess=="wrong": + response=int(input("I am thinking of a number between 0 and 100. Can you guess what it is? Type a number between 0 and 100 to try to guess it." ))0 + try: + val=int(response) + except ValueError: + print("Opps, something went wrong. Please try again. Type a number between 0 and 100.") + continue + val=int (response) + if valnumber: + print("No, your number is too high. Please try again.") + else: + print("Amazing! You correctly guessed the number! Congratulations.") + checkGuess="correct" + +print("Thank you for playing this simple Number Guessing game.") \ No newline at end of file From db94a283d1a28afc5ad130378714500be72507e1 Mon Sep 17 00:00:00 2001 From: eo4wellness Date: Thu, 14 Oct 2021 12:27:54 -0500 Subject: [PATCH 05/10] Create simple-SD.py --- Python/simple-SD.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Python/simple-SD.py diff --git a/Python/simple-SD.py b/Python/simple-SD.py new file mode 100644 index 0000000..10dc721 --- /dev/null +++ b/Python/simple-SD.py @@ -0,0 +1,18 @@ +# Hacktoberfest 2021 +# Problem: House Prices +# +# You are given an array that represents house prices. +# Calculate and output the percentage of houses that are within one standard deviation from the mean. +# To calculate the percentage, divide the number of houses that satisfy the condition by the total number of houses, and multiply the result by 100. + +import numpy as np + +data = np.array([150000, 125000, 320000, 540000, 200000, 120000, 160000, 230000, 280000, 290000, 300000, 500000, 420000, 100000, 150000, 280000]) + +m = np.mean(data) +d = np.std(data) +y1 = m-d +y2 = m+d +s = len(data [(data > y1) & (data < y2)]) +r = (s/len(data))*100 +print(r) \ No newline at end of file From deddccaf9f881d087462ec7a58671f2778b5aeb9 Mon Sep 17 00:00:00 2001 From: eo4wellness Date: Thu, 14 Oct 2021 12:46:27 -0500 Subject: [PATCH 06/10] Delete Exponentiation.py --- Python/Exponentiation.py | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 Python/Exponentiation.py diff --git a/Python/Exponentiation.py b/Python/Exponentiation.py deleted file mode 100644 index ba61fdd..0000000 --- a/Python/Exponentiation.py +++ /dev/null @@ -1,15 +0,0 @@ -# hacktoberfest 2021 -# Exponentiation -# Exponentiation is the raising of one number to the power of another. -# This operation is performed using two asterisks **. -# Let's use exponentiation to solve a known problem. -# You are offered a choice of either $1.000.000 or $0.01 (one penny) doubled every day for 30 days (the resulting amount is doubled every day). -# -# Task: -# Write a program to calculate the amount that will result from the doubling to understand which choice results in a larger amount. -# -#Hint: -# Let's see how exponentiation can be useful to perform the calculation. -# For example, if we want to calculate how much money we will have on the 5th day, we can use this expression: 0.01*(2**5) = 0.32 dollars (multiply the penny by 2 raised to the power of 5). -# Use the print statement to output the resulting amount. -print (0.01 *(2 **30)) \ No newline at end of file From 2a886a11b3f7450792aa6b92497957b4e3706af8 Mon Sep 17 00:00:00 2001 From: eo4wellness Date: Thu, 14 Oct 2021 12:46:30 -0500 Subject: [PATCH 07/10] Delete simple-number-guessing-game.py --- Python/simple-number-guessing-game.py | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 Python/simple-number-guessing-game.py diff --git a/Python/simple-number-guessing-game.py b/Python/simple-number-guessing-game.py deleted file mode 100644 index 64291f3..0000000 --- a/Python/simple-number-guessing-game.py +++ /dev/null @@ -1,24 +0,0 @@ -# Hacktoberfest 2021 - -import random -number=random.randrange(0,100) -checkGuess="wrong" -print("Welcome to a Number Guessing Game") - -while checkGuess=="wrong": - response=int(input("I am thinking of a number between 0 and 100. Can you guess what it is? Type a number between 0 and 100 to try to guess it." ))0 - try: - val=int(response) - except ValueError: - print("Opps, something went wrong. Please try again. Type a number between 0 and 100.") - continue - val=int (response) - if valnumber: - print("No, your number is too high. Please try again.") - else: - print("Amazing! You correctly guessed the number! Congratulations.") - checkGuess="correct" - -print("Thank you for playing this simple Number Guessing game.") \ No newline at end of file From a7dbac824d5f38b099083371026c9b9012a2d7fd Mon Sep 17 00:00:00 2001 From: eo4wellness Date: Thu, 14 Oct 2021 12:46:32 -0500 Subject: [PATCH 08/10] Delete simple-password-utility.py --- Python/simple-password-utility.py | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 Python/simple-password-utility.py diff --git a/Python/simple-password-utility.py b/Python/simple-password-utility.py deleted file mode 100644 index 0e80e19..0000000 --- a/Python/simple-password-utility.py +++ /dev/null @@ -1,6 +0,0 @@ -# hacktoberfest 2021 -import string -from random import * -characters = string.ascii_letters + string.punctuation + string.digits -password = "".join(choice(characters) for x in range(randint(8, 16))) -print ("Your new randomly generated password is: " + password) \ No newline at end of file From b51f7fa5b59c4d731b919dcac2abf49de9beb848 Mon Sep 17 00:00:00 2001 From: eo4wellness Date: Thu, 14 Oct 2021 12:46:35 -0500 Subject: [PATCH 09/10] Delete simple-SD.py --- Python/simple-SD.py | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 Python/simple-SD.py diff --git a/Python/simple-SD.py b/Python/simple-SD.py deleted file mode 100644 index 10dc721..0000000 --- a/Python/simple-SD.py +++ /dev/null @@ -1,18 +0,0 @@ -# Hacktoberfest 2021 -# Problem: House Prices -# -# You are given an array that represents house prices. -# Calculate and output the percentage of houses that are within one standard deviation from the mean. -# To calculate the percentage, divide the number of houses that satisfy the condition by the total number of houses, and multiply the result by 100. - -import numpy as np - -data = np.array([150000, 125000, 320000, 540000, 200000, 120000, 160000, 230000, 280000, 290000, 300000, 500000, 420000, 100000, 150000, 280000]) - -m = np.mean(data) -d = np.std(data) -y1 = m-d -y2 = m+d -s = len(data [(data > y1) & (data < y2)]) -r = (s/len(data))*100 -print(r) \ No newline at end of file From 47a83c91b5f66efb8f54baafa1b1f5510eb3bdef Mon Sep 17 00:00:00 2001 From: EO4Wellness <55713583+EO4wellness@users.noreply.github.com> Date: Thu, 14 Oct 2021 12:51:07 -0500 Subject: [PATCH 10/10] random pw generator this is a simple python utility program to randomly generate a password --- Python/simple-password-utility.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Python/simple-password-utility.py diff --git a/Python/simple-password-utility.py b/Python/simple-password-utility.py new file mode 100644 index 0000000..a78e212 --- /dev/null +++ b/Python/simple-password-utility.py @@ -0,0 +1,6 @@ +# hacktoberfest 2021 +import string +from random import * +characters = string.ascii_letters + string.punctuation + string.digits +password = "".join(choice(characters) for x in range(randint(8, 16))) +print ("Your new randomly generated password is: " + password) \ No newline at end of file