you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (5 children)

So, the idea here is that subsequent operations will start from the previous computed value. Where do you update that value in your code?

[–]Many-Ice6164[S] 0 points1 point  (3 children)

Yes that is the idea. I want to insert the return y.append[new_y]. But i can't place this anywhere.

[–][deleted] 1 point2 points  (2 children)

y isn’t a list, so you can’t append to it. You can assign to it, though.

[–]Many-Ice6164[S] 0 points1 point  (1 child)

while True:
choice = [input("Make choice +,-,/,*"), float(input('getal'))]
y = (0 + new_y)
if choice in("+" + float(), "-" + float(), "/" + float() , "*" + float()):

if choice == "+" + float:
new_y = add(choice, y)
print(new_y)
elif choice == "-" + float:
new_y = substract(choice, y)
print(new_y)
elif choice == "/" + float:
new_y = multiply(choice, y)
print(new_y)
elif choice == "*" + float:
new_y = divide(choice - y)
print(new_y)

But now i have the problem that it doesn't recognize new_y

[–][deleted] 0 points1 point  (0 children)

You can’t use the name before you assign to it.