Forum Stats

  • 3,735,089 Users
  • 2,247,103 Discussions
  • 7,857,681 Comments

Discussions

Help Coding

930375
930375 Member Posts: 1
edited Apr 15, 2012 3:55PM in Python
Been working on this in Python for awhile, but I am getting no where, and would appreciate it if someone could help?

Implement a function selectSome() that takes as a parameter a list of student names (i.e. strings) and a list of special characters. It prints those names in the first list that start with the letters in the second list. Capitalization shouldn't matter when selecting the names. If an empty list is provided as either parameter, the function doesn't print anything. The information below shows how you would call the function selectSome() and what it would display for some example parameters:
selectSome(["Eva", "Sam", "Carly", "Tanya", "Owen", "Anna"], ['A', 'B', 'C', 'D', 'E', 'F'])
Eva
Carly
Anna
selectSome(["Hanna", "Bob", "chris", 'Fred', 'Alex'], ['a', 'F', 'C'])
chris
Fred
Alex
selectSome([], ['a', 'b', 'c'])
selectSome(['Eva', 'Bob'], [])

Answers

This discussion has been closed.