Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) *in python* a. Given a string, determine if the string begins with green or purple and if it does, return that color string. Otherwise,

1) *in python*

a. Given a string, determine if the string begins with "green" or "purple" and if it does, return that color string. Otherwise, return an empty string.

Examples:

seeColor("greenxx") -> "green" seeColor("xxgreen") -> ""

b.

Given a string, count the number of words ending in 'y' or 'z'--so the 'y' in "heavy" and the 'z' in "fez" count, but not the 'y' in "yellow" (not case sensitive). We'll say that a y or z is at the end of a word if there is not an alphabetic letter immediately following it. (Note: isalpha() returns True if all characters in a string are alphabetic letters.)

Examples:

countYZ("fez day") -> 2 countYZ("day fyyyz") -> 2

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_2

Step: 3

blur-text-image_3

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

Deductive And Object Oriented Databases Second International Conference Dood 91 Munich Germany December 18 1991 Proceedings Lncs 566

Authors: Claude Delobel ,Michael Kifer ,Yoshifumi Masunaga

1st Edition

3540550151, 978-3540550150

More Books

Students also viewed these Databases questions

Question

What is Web analytics? What are the metrics used in Web analytics?

Answered: 1 week ago