Using three lists of words: subjects, verbs, and objects, as given below, write a Python program to
Fantastic news! We've Found the answer you've been seeking!
Question:
Using three lists of words: subjects, verbs, and objects, as given below, write a Python program to generate all the grammatically correct sentences with subject, verb and object by ensuring appropriate subject-verb combinations. Some of the restrictions are
- "am" is used only with the subject "I."
- "Is" is used only with "He," "She," and "It."
- "are" is used only with "We" and "They."
- "Was" is used only with "I," "He," "She," and "It,"
- "were" is used only with "You," "We," and "They."
Use the following line of code to start:
subjects = ["I", "You", "He", "She", "It", "We", "They"]
verbs = ["am", "is", "are", "was", "were", "will be", "have been", "had been"]
objects = ["happy", "sad", "angry", "hungry", "tired", "excited", "scared"]
Related Book For
Artificial Intelligence Structures And Strategies For Complex Problem Solving
ISBN: 9780321545893
6th Edition
Authors: George Luger
Posted Date: