This condition:
if passretry == 'yes' or 'Yes':
means "If passretry == 'yes' is true, or 'Yes' is true". 'Yes' is always true, because a non-empty string counts as true. That's why you're always taking the first code path.
You need to spell things out a little more:
if passretry == 'yes' or passretry == 'Yes':
(Or to make your code a bit more general:
if passretry.lower() == 'yes':
which would allow for people shouting YES.)