hi, I like the graphical representation of the calculator xD
I'd try to avoid long if/elif sequences used to adjust the amount of empty spaces depending on the length of some number, you could check the lenght of the number and use multiplication to get desired amount of spaces using something like this:
Code
result = 10000
print ("SPACE" * len(str(result))) # just replace "SPACE" with " "
Also to make the code more readable while having many options for the user to pick you could use list with functions instead of long if/elif sequences like this:
Code
def Func_Addition(x, y):
return x+y
def Func_Substraction(x,y):
return x-y
functions = [
Func_Addition,
Func_Substraction
]
while True:
option = int(input("\nPick an option: 1-Addition, 2-Substraction\n> "))
print(functions[option - 1](5,10))
Ultimately you could avoid using multiple functions dedicated for the calculations and replace them with simple eval() function which takes a string parameter and treats it as if it was a python instruction so it does the calculation for you as long as you put the right mathematical operation inside the string like eval("2 + 2") which will return 4. You could create another list with mathematical operators and use it like this:
Code
first_number = 5
second_number = 10
math_operators = [
"+",
"-"
]
while True:
option = int(input("\nPick an option: 1-Add, 2-Sub\n> "))
print(eval(str(first_number) + math_operators[option - 1]+ str(second_number)))
I'd recommend this video to you:
https://www.youtube.com/watch?v=OSGv2VnC0go
I wouldn't bother about the "I hope you know it's retarded" useless comments because the code efficiency will come with experience as long as you learn+practice, especially with a language like python which allows to automate complex tasks in a very concise way