Welcome to Westonci.ca, your go-to destination for finding answers to all your questions. Join our expert community today! Discover a wealth of knowledge from experts across different disciplines on our comprehensive Q&A platform. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.
Sagot :
Let's check what can be modified
Before calling def we need adjective and conjunctions stored inside variables
Store them(You may change according to your choice)
[tex]\tt adjectives=("foolish","bad","long","hard")[/tex]
[tex]\tt conjunctions=("and","but","for","after")[/tex]
We have to make optional ,easy way ask the user to do instead of yourself .
[tex]\tt con=input("Enter\: yes\: if \:you \:want \:to \:use \:conjunctions:")[/tex]
[tex]\tt adj=input("Enter\:yes\:if\:you\:want\:to\:use\: adjectives:")[/tex]
If they click then we can proceed else no problem let the program run
[tex]\tt def\: conjunctionPhrase():[/tex]
[tex]\quad\tt if\: con=="yes":[/tex]
[tex]\quad\quad\tt return\:random.choice(conjunctions)+"\:"+nounPhrase()[/tex]
[tex]\quad\tt else:[/tex]
[tex]\quad\quad\tt continue[/tex]
- You may use pass also
[tex]\tt def\: adjectivePhrase():[/tex]
[tex]\quad\tt if\:adj=="yes":[/tex]
[tex]\quad\quad\tt return\:random.choice(adjectives)+"\:"+nounPhrase()[/tex]
[tex]\quad\tt else:[/tex]
[tex]\quad\quad\tt continue[/tex]
We appreciate your time. Please revisit us for more reliable answers to any questions you may have. Thank you for your visit. We're dedicated to helping you find the information you need, whenever you need it. Get the answers you need at Westonci.ca. Stay informed by returning for our latest expert advice.