Feb-18-2018, 09:34 AM
yes, that are correct, my logic was confused. However I've come to the conclusion that it's not possible to do this at all in the way I'd assumed. I'm not saying I'm right in this - after all, this would seem a classic rookie error "It can't be done!" - but I'll say why just in case there's more I can learn.
I reduced my central problem to trying to do this - which produces an error of course, because presumably this is not allowed:
I reduced my central problem to trying to do this - which produces an error of course, because presumably this is not allowed:
def reassign(x, y): return x > y = True reassign(5, 6) #my intention above is to produce the result 5 > 6 == True so that e.g. "rock" beats "scissors" print(reassign(5, 6))This is where the idea currently fails. I'm trying to assign some 'order of truth' to "rock", "paper" and "scissors". As far as I'm currently aware making a comparison does not allow me to do this. Of course I can define a function which takes
pn = input("Player n choice: ")and compare them, but then I end up putting the same 'long hand' if/elif inside the function that are my current solution where no function is involved at all.