randomly choose from list using random.randint in python
Question: How to use `random.randint()` to select random names given in a list in
python.

I want to print 5 names from that list. Actually i know how to use
`random.randint()` for numbers. but i don't know how to select random names
from a given list.

we are not allowed to use `random.choice`.

help me please


Answer: This will not guarantee no repeats, since random.choice is better for that.

    
    
    import random
    names = ["A", "B", "C", "D", "E", "F", "G", "H", "I"]
    print([names[random.randint(0, len(names)-1)] for i in range(5)])
    

