Python Forum

Full Version: How to import random?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Extremely stupid question below, beware. NSFW

Hello, I have been browsing the web and have come across a number guessing game in Python. I have created my own, but instead of me coming up with the endgame number, I want a random number for every instance.

When I type in "import random" in PyCharm, it is grayed out. Is this because I do not possess the module files? If so, how and where do I go about downloading them?

Thank you.
random is part of standard python library, so you don't need to import anything. To avoid stupid mistake - don't name your own file random.py.
That said, it's not clear what the problem is. Do you get any error when you create new file, write just a single line import random, save the file under some name and run it?