Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#Write a function called lucky _ sevens that takes in one #parameter, a string variable named a _ string. Your function #should return True if
#Write a function called luckysevens that takes in one
#parameter, a string variable named astring. Your function
#should return True if there are exactly three s in
#astring. If there are less than three or more than three
#s the function should return False.
#
#For example:
# luckysevenshappybday" should return True.
# luckysevenshappybday should also return True.
# luckysevenshappybday" should return False.
# luckysevenshappybday" should also return False.
#
#Hint: Remember in Chapter we covered how to use a loop
#to look at each character in a string.
#Write your function here!
#Below are some lines of code that will test your function.
#You can change the value of the variables to test your
#function with different inputs.
#
#If your function works correctly, this will originally
#print: True, True, False, False, each on their own line.
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