Answered step by step
Verified Expert Solution
Link Copied!

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)

image text in transcribed

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 marks

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions