Use the count method:
import random mylist = [] for i in range(0,10): x = random.randint(1,7) mylist.append(x) print (mylist) print (mylist.count(7))