Question
PYTHON PROGRAMMING # 1. Reference limerick.png on Blackboard for this problem. # Put the text of the poem on Blackboard into the empty String #
PYTHON PROGRAMMING
# 1. Reference limerick.png on Blackboard for this problem.
# Put the text of the poem on Blackboard into the empty String
# that is currently the value of the variable limerick so that
# the result looks EXACTLY like the result on Blackboard when printed.
limerick = 'An epicure dining at Crewe Found a rather large mouse in his stew. Cried the water, \"Don\'t shout Or wave it about Or the rest will be wanting one too.\"\
print(limerick)
# 2. Ask the user if they like jazz (yes/no). Use a while loop
# to validate the input so that they can enter 'yes' or 'no' with
# any combination of upper and lowercase letters and will still be valid.
# 3. Ask the user for their name. Use a for loop to count the
# number of times the letter 'e' appears in their name (upper or lower case).
# Print the result: 'You have ' + es + ' es in your name.'
# 4. Use the string results below for this problem. First,
# remove the whitespace from either side of the string.
# Then, use the split() method to help you count the number of
# occurrences of 'yes' and 'no' that occur. You will need to
# split the string and then use a for loop to count.
# Print the results of your count:
# Results
# yes: #
# no: #
results = ' yes,no,yes,no,yes,yes,no,yes,yes,no '
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