Ah, this should actually be
cnum = names[random.randint(0, len(names) - 1)]
Because of 0-indexing. That, and I forgot to give the first parameter to randint, haha.
And yeah, len(names) literally translates to "the length of the names array", so if it had 50 names in it, len(names) would be 50.