Need some help coding

(1) Please describe the actual problem.

(2) Note that .keys returns a list object, as it might contain several keys (thus why it is called keys rather than key). So your comparisons need to take that into account. e.g.

if key_resp_5.keys[0] == str(RespCorr): # compare two individual strings

or

if key_resp_5.keys == [str(RespCorr)]: # compare two lists containing a string

(3)