Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Artificial Intelligence Structures And Strategies For Complex Problem Solving

Authors: George Luger

6th Edition

0321545893, 9780321545893

More Books

Students also viewed these Databases questions

Question

Create and justify your own definition of artificial intelligence.

Answered: 1 week ago

Question

What does the word trophic mean?

Answered: 1 week ago