Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to define a function called searchNames(searchString): that will accept the search and check if the string is a part of any of the

I need to define a function called
searchNames(searchString): that will accept the search and check if the string is a part of any of the tuples. If so, the tuple should be printed out if it corresponds with the word searched. Search should NOT be case sensitive. Thanks!
Example:
name_info = [('Anne', '18', 'freshman'),
('Jerry', '21', 'Senior'),
('Sally', '18', 'Freshman'),
('Frank', '22', 'SENIOR')]
def searchNames(searchString) :
??? (dont know what to put here)
searchNames('senior')
print("...........................")
searchNames('18')
print("...........................")
searchNames('jerry')
print("...........................")
Example output:
('Jerry', '21', 'Senior')
('Frank', '22', 'SENIOR')
....................................
('Anne', '18', 'freshman')
('Sally', '18', 'Freshman')
....................................
('Jerry', '21', 'Senior')

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

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions