Jump to content
Killersites Community
Sign in to follow this  
Julien

Python 3 Course: Treasure Hunt Game

Recommended Posts

Hello, 

I've been going through the videos 40 to 44 and writing all the code for the Treasure Hunt Game. I keep getting an error message:

TypeError: int() argument must be a string, a bytes-like object or a number, not 'function'

random_cave = random.randint(1,2)

    if random_cave == int(chose_cave):
        print("---->you found treasure!")
    else:
        print("---->you were eaten by a monster")

 

Any ideas? Is this just a version problem? Using 3.6.5 

Regards, 

Julien

 

Share this post


Link to post
Share on other sites

Not a version problem. The error is telling you: you are sending a function as the argument when it is expecting a string or number. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×