Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started