Guess the computer's number using functions I am looking to improve the Python Number Guessing Game program:


How is the overall structure of the code?
Have I used functions to the best of their ability?
Can the code be simplified? If yes, please feel free to show how.
The replay_game() function especially seems un-pythonic and overkill.




# Guess My Number Game
# MacOSX (Latest), Python 3.4.3, 27/08/2017
# Guess The Computers number between 1-100

from random import randint
from time import sleep

def gen_number():
    random_number = randint(0, 101)
    return random_number

def intro():
    print("Welcome to, Guess My Number!")
    print("Simply guess the number between 1-100 that the Computer is 'thinking' of!")
    print()

def ask_number(question, random_number):
    response = None
    while response != random_number:
        try:
            response = int(input(question))
            if response &gt; random_number:
                print("Lower... ")
            elif response &lt; random_number:
                print("Higher... ")
            else:
                correct = response
                congrat_winner(correct, random_number)
        except ValueError:
                print("Invalid. Enter a number between 1-100 ")
    return response

def human_guess():
    print("Ok Human! Let's begin... ")
    sleep(1)
    random_number = gen_number() # Named the variable random_number, the same as the variable in gen_number(). Is this good practise?
    guess = ask_number("Guess the number: ", random_number)

def congrat_winner(correct, random_number):
    if correct == random_number:
        print()
        print("Calculating results...")
        sleep(1)
        print()
        print("WELL DONE!")
        print("The answer was indeed,", str(correct) + "!")

def replay_game():
    replay_question = None
    while replay_question != 'y' or 'n':
        replay_question = input("Would you like to play again (y/n)? ").lower()
        if replay_question == 'y':
            print()
            print("Rebuilding game... ")
            main()
        elif replay_question == 'n':
            print("Goodbye!")
            exit()
        else:
            print("please enter either 'y' or 'n'... ")

def main():
    intro()
    human_guess()
    replay_game()

main()
There is a classic problem in this condition:

while replay_question != 'y' or 'n':


It always evaluates to True since string n is always truthy.

And, here is a set of code style violations I would work on:


guess variable inside the human_guess() function is unused
keep 2 blank lines between the function definition (PEP 8 - Style Guide)
put the main() function call into under the if __name__ == '__main__': 
the print("Invalid. Enter a number between 1-100 ") is overly indented with 8 spaces, use 4 spaces
you can use a multi-line string for your intro message:

print("""
Welcome to, Guess My Number!
Simply guess the number between 1-100 that the Computer is 'thinking' of!
""")