Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use python 1. Define a value-returning function that returns the shortest one of three strings entered as parameters. Solve this without a string traversal

image text in transcribedplease use python

1. Define a value-returning function that returns the shortest one of three strings entered as parameters. Solve this without a string traversal algorithm! Do not use the min() function. Test your function (i.e. call it several times with different parameters) 2. Define a value-returning function countNonDigits(myString) that counts and returns the number of characters in the string that are not digits. (digits are between ' 0 ' and ' 9 ') in the myString parameter. (see lecture slide 20 for a similar example.) Call the function (in a print statement) three times to test it with different arguments. 3. Define a void function that prints only the lower-case letters of a string given as parameter and skips all other characters. All lower-case characters must be printed in one line. Use print(char, end="') for printing without a new line. Use the ord() function in your solution to check if a letter is a non-capital letter. Call the function (three times) with "alpha", "Alpha" and "67Alpha\#\#" as test arguments

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

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago