# The result variable in computer programming doesn't work.

Asked 5 months ago, Updated 5 months ago, 17 views

I created a program that allows me to do simple calculations with python 3 and save up to 10 calculations in a list, and save the answers after the 10th one from the beginning, but no matter how many times I re-programmed it,

name 'result' is not defined

The only error was that the and result variables were not defined.I thought, "Did I forget to define the result?" and checked the code several times, but I didn't find any particular definition errors or errors in the variables in the module.
Please tell me where you forgot to define the result variable in this code, or what is wrong with the variable

`````` answerlist=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
counter = 1

defdecideprocess():
global decision
decision=str(input("Enter+for adding, -for subtraction, *for multiply, /for deviding, and 'all' for see what all calculation results so far.:"))

default processes (result):
global decision
global counter
decision=decideprocess()
while decision=="+" or decision=="-" or decision=="*" or decision=="/" or decision=="all":
if decision=="+":
decideprocess()

return counter

elif decision=="-":
result=subtraction()
decideprocess()

return counter

elif decision=="*":
result=multiplecation()
decideprocess()

return counter

elif decision=="/":
result=device()
decideprocess()

return counter

elif decision=="all":
decideprocess()

else:
showallresult()

return result

default():
global counter
a=float(input("Enter any number.":")
b=float(input("Enter any number.":")
result=a+b
print(result)
counter=counter+1
assignment(result)

return(result)

def subtraction():
global counter
a=float(input("Enter any number.":")
b=float(input("Enter any number.":")
result = a-b
print(result)
counter=counter+1
assignment(result)

return result

default multiplexing():
global counter
a=float(input("Enter any number.":")
b=float(input("Enter any number.":")
result=a*b
print(result)
counter=counter+1
assignment(result)

return result

def deviation():
global counter
a=float(input("Enter any number.":")
b=float(input("Enter any number.":")
result = a/b
print(result)
counter=counter+1
assignment(result)

return result

default assignment(result):
global counter
while counter <10:
if counter>=10:
changecountervalue()

return result, newcounter

global counter

return result

def changecountervalue():
global counter
counter10 = int (counter/10)
newcounter=(counter10*10) - counter

return newcounter

return result, newcounter

default showallresult():

default calculator(result):
global counter
global decision
processes(result)

return result

default CALCULATOR(result):
calculator(result)

return result

CALCULATOR (result)

``````

python python3

2022-09-30 11:15

Please tell me where you forgot to define the result variable in this code, or what is wrong with the variable

Last line

``````CALCULATOR(result)
``````

The argument `result` is undefined.

2022-09-30 11:15

## If you have any answers or tips

Popular Tags
python x 4627
android x 1593
java x 1492
javascript x 1425
c x 924
c++ x 877
ruby-on-rails x 696
php x 692
python3 x 683
html x 656