Indentation is very important in python. You need to indent code inside while loops, for loops, if statements, etc. You don't seem to be indenting.
In this example:
while (secretNum != userGuess):
userGuess = int(input("Guess a number between 1 and 20: "))
Although, you might need to indent more than only this line. I hope this helps.