i am trying to write code to set variable 'length' to the length of a list called the value of split[c], and have a random str from that list be printed.
Here's the code:
spit=input().split(' ')
c=0
#the bit i am having trouble with
def spitter():
exec('length=len('+spit[c]+')-1')
rand=random.randrange(0,length)
exec('print('+spit[c]+'[rand])')
while not c==len(spit):
spitter()
c=c+1