PHP Code
<?php
def generate(nouns,verbs,number_of_sentence,filename):
for num in range(number_of_sentence):
go = open(filename,"w")
print(random.choice(nouns).rstrip(),random.choice(verbs).rstrip(),random.choice(nouns),file=go)
go.close()
if __name__ == "__main__":
nouns = get_list("nouns.txt")
verbs = get_list("verbs.txt")
generate(nouns,verbs,100,"sentences.txt")
Hey all, im not able to get the for in loop to work for me. Could a 2nd pair of eyes take a look and point me in the right direction? it needs to produce multiple sentences but at the moment is only producing one.
Thanks



![[Image: ouURNlq.png]](https://i.imgur.com/ouURNlq.png)
![[Image: 5BgQiIm.gif]](https://i.imgur.com/5BgQiIm.gif)