Hello. I am learning Python, and this is my first app. I am getting this error: NameError: name ‘Verb’ is not defined. Massive thanks in advance for any help!
""" Generate sentence type one """
def sentencetype1(Verb, Adjective, Noun):
rand = random.randint(1,2)
if rand == 1:
text = "I want to "
if rand == 2:
text = "I "
verb_choices = random.sample(Verb, 12 + themevector1)
text = text + random.choice(verb_choices)
text + " the "
if random.randint(1,2) == 1:
adjective_choices = random.sample(Adjective, 12 + themevector1)
text + random.choice(adjective_choices)
noun_choices = random.sample(Noun, 12 + themevector1)
text + random.choice(noun_choices)
else:
noun_choices = random.sample(Noun, 12 + themevector1)
text + random.choice(noun_choices)
return text
""" Paragraph builder """
def paragraphbuilder():
numbersentences = random.randint(1,50)
x = 1
while x < numbersentences:
sentencetype = 1
if sentencetype == 1:
sentencetype1(Verb, Adjective, Noun)
x += 1
return
""" Generate story """
y = 1
while y < numberparas:
paragraphbuilder()
y += 1