Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python (a) Write a function named check_name which takes in two string parameters named: - name (a person's name), and - fave_letter (an alphabetical character)
Python
(a) Write a function named check_name which takes in two string parameters named: - "name" (a person's name), and - "fave_letter" (an alphabetical character) The function should return True iff the given name begins with the given fave_letter You may assume all characters are lowercase (no need to check for uppercase equivalence within the function) Examples of calling this function and the expected output >>check_name 'sephiroth', 's') True >>> check name ('tifa', 's') False (b) Write a function named check_name_count which takes in three parameters named: - "name" (a person's name) and - "fave_letter" (an alphabetical character), and - "num" (an integer value) This function should return True iff the given fave_letter occurs at least num times within the given name Again, you may assume all characters are lowercase (no need to check for uppercase equivalence within the function) Examples of calling this function and the expected output: >>> check_name_count ('sephiroth', 's', 2) False >>check_name_count ('tifa', 't', 1) True >>> check_name_count ('sephisrotsh', 's', 2) True Your functions for both of the above should also have proper, complete docstrings to get full marksStep 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