How do I make an operator a variable? for example I want to store the value 1 in operator '+' that is "+" = 1. But python is showing an error, what do I do? my project is this: while True:
current_number = int(input("Enter the number that you wish to be displayed: "))
print(f"The current displayed number is: {current_number}")
print("The value of '+' and '-' is limited to 5")
n = input()
if n == "+" or "++" or "+++" or "++++" or "+++++":
if n == "+":
print(current_number + 1)
if n == "++":
print(current_number + 2)
if n == "+++":
print(current_number + 3)
if n == "++++":
print(current_number + 4)
if n == "+++++":
print(current_number + 5)
elif n == "-" or "--" or "---" or "----" or "-----":
if n == "-":
print(current_number - 1)
if n == "--":
print(current_number - 2)
if n == "---":
print(current_number - 3)
if n == "----":
print(current_number - 4)
if n == "-----":
print(current_number - 5)
I want to simplify the code by making "+" = 1, how do I do it?