Skip to content

Tag: python-3.x

Entry not updating tkinter python

Im trying to make a rock paper scissors game using the python module tkinter to create a window with an input box. However im struggling to get the entry box to update to another value everytime i press the button. What im struggling with i.e if I was to write Rock as an input (assume computer response is alw…

Can this for loop be vectorized?

Can this for loop be vectorized maybe by expanding dimensions and then collapsing it? I got the hint from somewhere that I can replace with Answer It can be vectorized by expanding dimensions as you suggested. I think the secret sauce is using np.tril to zero out terms in the progression before summing: