Having trouble with Python functions in my Guess The Number Game P
<p>I'm having troubles getting a proper readout, guessed keeps coming up as undefined but I have definitely defined it there.</p>

<p>Sorry about the terrible code, I'm really really new to this.</p>

<p>If there are any problems past my probably really easy to see simple mistake, please inform me about that too!</p>

<p>Thank you!!!</p>

<pre><code>import random


def main():

    print "Hello what is your name?"
    name = raw_input()

    print ""
    number = input("Well, "+name+", I am thinking of a number between 1 and 100. Please type your first guess: ")
    guess(number)

def guessing(number1):

    guessed = False
    num_guesses = 0
    randomNumber = random.randrange(1, 100)
    while num_guesses &lt; 7 and not guessed:
        print "Please enter a guess."
        guess = int(raw_input())
        num_guesses += 1
        if guess == num:
          guessed = True
        elif guess &gt; num:
          print "Too High"
        else:
          print "Too Low"
        if guessed:
          if num_guesses &gt; 1:
            print "Congratulations! You got the number in", num_guesses,    "guesses."
          else:
            print "Congratulations! You got the number in 1 guess."
        else:
            print "You did not guess the number in",num_guesses,"guesses."

    playAagain = raw_input ("Excellent! You guessed the number! Would you like to play again (y or n)? ")
    if playAagain == "y":
            main()

    main()
</code></pre>

<p>Like others pointed out, calling out the wrong function was the main one, still, there are other errors present. I'm using Python 3.5 so I had to edit it a bit. It's not perfect but it runs, just so you can learn from it.</p>

<pre><code>import random


def main():

    print ("Hello what is your name?")
    name = input()

    print ("")
    print ("Well, "+name+", I am thinking of a number between 1 and 100.     Please type your first guess: ")

    guessed = False
    num_guesses = 0
    num = random.randrange(1, 100)

    while num_guesses &lt; 7 and not guessed:
        print ("Please enter a guess.")
        guess = int(input())
        num_guesses += 1
        if guess == num:
            guessed = True
        elif guess &gt; num:
            print ("Too High")
        else:
            print ("Too Low")
    if guessed:
        if num_guesses &gt; 1:
            print ("Congratulations! You got the number in", num_guesses, "guesses.")
        else:
            print ("Congratulations! You got the number in 1 guess.")
    else:
        print ("You did not guess the number in",num_guesses,"guesses.")

    playAagain = input ("Excellent! You guessed the number! Would you like to play again (y or n)? ")
    if playAagain == "y":
        main()

main()
</code></pre>

python function