Question: I have ahomework Question for my Python Programming Class Create the Python program on page 182. Test the program to make sure that it works
I have ahomework Question for my Python Programming Class
Create the Python program on page 182. Test the program to make sure that it works correctly.
Modify the program as follows:
Change Author to your name
Add the date you created the program
Add two new nouns
Add two new verbs
Test your changes
Submit your program as a .py file
Heres my Code Thus Far what am i missing
"""" Program: generator.py Author Stephen Griffin Generates and Displays sencentces using simple grammar and vocabulary. Words are chosen at random """ import random
artiles = ("A","THE") nouns = ("BOY. "GIRL","BAT","BALL",) verbs =)"HIT","SAW","LIKED") prepositions = ("WITH","BY")
def sentence(): """ Builds and returns a sententce. """ return nounPhrase() +""+ verbphrase() def nounPhrase(): """Builds and returns a noun phrase.""" retrun random.choice(articles)+" " + random.choice(nouns) def verbPhrase(): """Builds and retruns a verb phrase.""" retrun random.choice(verbs)+" " + nounPhrase() +" " +\ prepositionalPhrase() def prepositionalPhrase(): """Builds and returns a prepositional Phrase.""" return random.choice(prepositions)+ " " + nounPhrase() def main(): """ Allows the user to input the number of sentences to generate.""" number = int(input("Enter the number of Sentences: ")) for count in range(nmumber): print(sentence())
main()

Homework.py-C:/Users/date7 File Edit Fonmat Run Opticns Window Help Homework-201805-32- x Bookshelf Onine: Funds http/ijec.open.suny.e ?course id= 14D06 18!content id= 510126 1 secure Apps Plans MilleniccmDWelcamehttps//Mearn.sckansLambds AcadermyoSouthwestem Colleg haw to request a certMavis Progzam: generator.py Auchor Stephen Eriftin Generatea and Diaplaya sencent.ces uaing aimple grammar and vocabulary. Words aze choaen at random r bookmarks JCC port randon. S UN Y . | Learning Content > Nomewbrk ++ nouns-"BOY."GIRL"BAT","BALL", verbsHIT"."SA" LIKED" Homework def sentence 201805-3249-CSC-1570- LE-Programming Concepts Appl Home return nounFhraac"+erophraac def nounPhraae Homework Drop Box " """Builds and return noun phrase retrun random . choice"(articles)" " + random . cno2ce[nouns) def verohrase 1. Create the Python program on page 182. Test the program to make sure that it 2. Modify the program as follows Builds and retruna a verb phrase Syllabus 1 Change Author to your name 2. Add the date you created the program 3 Add two new nouns 4. Add two new verbs def preposizionalfhrase): "Bu11da and returns a preposicional Phrase." Lcaning Coritent return random. choice (prepoaitions+"unPhrase) ,, " " Allow te u5er to Input the numb r of ent ence number-int(input ("Enter the number of Sentenes: " det main) 3 Test your changes 4. Submit your program as a py file to generace."n Course Messages My Grades Calendar tor count -n range (nmurber ; print (entence ) Homework 5 Drop Box Complete the following exercises in Chapter 4 Exercises 4.4.1 a.b.c.d; 4.4.2 a.b; 4.5.1, 2, 5 main ( JCC Student Support SUNY HalpDesk Blackboard Help Ln: 35 Col:0 Homework.4 Drop Box nswer all af the questions an page 126, Exercis 41 You can lest your code in Python bul submil your answers as a single Word document (ducx) Homework 3 Drop Box Type here to search
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
