Skip to content
← Back to Community
import random
Profile icon
minecraftmake55

how do i use import random for just strain lines of code and not for the hole thing

https://repl.it/@minecraftmake55/halo-monopoly

Answered by Bergreen [earned 5 cycles]
View Answer
Voters
Profile icon
Ma-AngelaAngela
Profile icon
katyadee
Profile icon
minecraftmake55
Comments
hotnewtop
Profile icon
Bergreen

If you only want to use the random library for certain sections of your code, then you should move that code into a separate python file, with the import random statement at the top.

For example, if you need to use the random library in your property class, you could make a new python file called Property.py, write import random at the top, and move your property class definition into that file.