Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics (Retired) Pick a Number! Any Number! Imports

Jason Williams
Jason Williams
453 Points

Python Basics, Stage 6 Challenge

okay, I'm a newbie and I'm struggling with this challenge. I've tried all ways to solve this and can't seem to manage it. I really need a hint because I don't know what I'm missing. Thanks, Jason

random_num.py
import random
def random_num(num):
  random.randint(1,num)

random_num(6)

1 Answer

Hi Jason,

You're getting the random number but you're not doing anything with it.

The challenge is asking you to have the function return that random number.

Also, in general you don't have to call your functions you only have to write them. The code challenge will call your functions to test them.

Jason Williams
Jason Williams
453 Points

That worked, appears so obvious to you. I'm jealous! Thank you