Hello. I am learning PYthon, and have no idea why I am getting this error. Thanks in advance!
Cell In[2], line 3
text = text += random.choice(verb_choices)“”
^
SyntaxError: invalid syntax
""" Generate sentence type one """
def sentencetype1():
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 += 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 += Noun[themevector1 + random.choice(12)]
return text