Created
April 30, 2020 18:58
-
-
Save zbrasseaux/61519a327e3c9bbbda8a92f76e7627ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# code to generate code seen in https://i.redd.it/azecoqeevyv41.jpg | |
MAX = 12 | |
print("\n\ndef function(num1, sign, num2):") | |
for i in range(MAX - 1): | |
for j in range(MAX - 1): | |
print("\tif num1 == " + str(i + 1) + " and sign == '*' and num2 == " + str(j + 1) + ":") | |
print("\t\tprint('" + str(i + 1) + "*" + str(j + 1) + "=" + str((i + 1)*(j + 1)) + "')") | |
for i in range(MAX): | |
for j in range(MAX): | |
print("\tif num1 == " + str(i + 1) + " and sign == '/' and num2 == " + str(j + 1) + ":") | |
print("\t\tprint('" + str(i + 1) + "/" + str(j + 1) + "=" + str((i + 1)/(j + 1)) + "')") | |
for i in range(MAX): | |
for j in range(MAX): | |
print("\tif num1 == " + str(i + 1) + " and sign == '+' and num2 == " + str(j + 1) + ":") | |
print("\t\tprint('" + str(i + 1) + "+" + str(j + 1) + "=" + str((i + 1)+(j + 1)) + "')") | |
for i in range(MAX): | |
for j in range(MAX): | |
print("\tif num1 == " + str(i + 1) + " and sign == '-' and num2 == " + str(j + 1) + ":") | |
print("\t\tprint('" + str(i + 1) + "-" + str(j + 1) + "=" + str((i + 1)-(j + 1)) + "')") |
Thank you, much appreciated
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code is the pinnacle of scientific achievement in 2020, ++