randNum = random.randrange (1,3)
NameMale = ['Noah']
NameFemale = ['Alyna']
Job = ['Accountant']
Age = random.randrange (18,81)
Gender = ['Male', 'Female']
Company = ['State Farm']
Event = ['A drunk driver hit me head-on']
if randNum == 1:
print ("Hi. I'm {}. I'm {} years old, and I was a(n) {} at {}. That is, until everything changed. One day, {}.").format((random.choice(NameMale)),(random.choice(Age)),(random.choice(Job)),(random.choice(Company)),(random.choice(Event)))
error message:
Traceback (most recent call last):
File "/home/pi/Scenario Generator.py", line 14, in <module>
print ("Hi. I'm {}. I'm {} years old, and I was a(n) {} at {}. That is, until everything changed. One day, {}.").format((random.choice(NameMale)),(random.choice(Age)),(random.choice(Job)),(random.choice(Company)),(random.choice(Event)))
File "/usr/lib/python2.7/random.py", line 275, in choice
return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty
TypeError: object of type 'int' has no len()
What does this mean, where is it coming from, and how can I solve it?