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,


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"]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!