I'm trying to write a program that will generate a random number between 1 and 100 and then ask the user for a guess. At that point if the guess is correct it will tell them so and vice-versa if it's wrong.
What I have so far is:
import random
def playGame2():
number = random.randint(1,100)
guess = input("I'm thinking of a number between 1 and 100. Guess what it is: ")
if str(number) == guess:
print("That is correct!")
else:
print("Nope, I was thinking of" +str(number))
When I run the program it just gives me <function playGame2 at 0x0000000002D3D2F0>
.
Why is it doing that?