News

If you only want to grab a random element from a list in Python, you can do this with the random package as well. Import the random package by including import random near the top of your code.
import random n = random.randint(1, 5) return n. ... We’ve compiled a list of the best online Python courses to take you to that next level. Check that out here.