Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Due today, thank you! 7) Write a tunction named g Le, that takes two arguments (you can safely assume that all arguments will always be

Due today, thank you! image text in transcribed
image text in transcribed
7) Write a tunction named g Le, that takes two arguments (you can safely assume that all arguments will always be integers). When this function is called, it should determine if the first argument value is greater than, less than, or equal to the second argument value. The function should then returrn the string "greater", "lesser", or "equal" depending on the argument values. Examples: g-l e(1, 2) will return "lesser g.1 ec2, 1) will return "greater g.1 e(2, 2) will return "equal" 8) Write a function named greatest difference, that takes three arguments (you can safely assume that all arguments will always be integers). When this function is called, it should determine which pair of argument values has the greatest difference. The function should return that difference. Examples: greatest.difference(1, 3, 9) will return 8 because 1 and 9 have the greatest difference, and the difference is 8 greatest.difference(9, 3, 3) wil return 6 because 3 and 9 have the greatest difference, and the difference is 6 greatest difference(3, 3, 3) will return because 3 and 3 have the greatest difference, and the difference is 0 9) Write a function named least difference, that takes three arguments (you can safely assume that all argum ents wil always be integers). When this function is called,it should determine which pair of argument values has the least difference. The function should return that difference. Examples least difference(1, 3, 9) will return 2 because 1 and 3 have the least difference, and the difference is 2 least difference(9, 3, 3) will return because 3 and 3 have the least difference, and the difference is least.difference(3, 2, 1) will return 1 because both 3 and 2, and 2 and 1 have a difference of 1, while 3 and 1 has a difference of 2 10) Write a function named has parts, that takes four arguments (you can safely assume that all arguments wil always be strings). When this function is called,it should determine if any two of the first three string values can be concatenated in any order to form the tourth string value. The function should return True or False depending on the argument values. has parts('a', 'bc', 'def', 'defa) will return True because 'def' and 'a' can be concatenated to form 'defa' has partsC'a', bc', 'def', 'adef) will return True because 'a and "def' can be concatenated to form "adef has partsC'a', 'bc','def, 'defb) will return False because there is no way to combine by concatenation any two of the strings C'a','bc', and 'def) to form "defb' has partsC'a abc' ab'aa) ill return True because 'a' can be concatenated with itself to form 'aa

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

Students explore these related Databases questions

Question

Discuss the Hawthorne experiments in detail

Answered: 3 weeks ago

Question

State the importance of control

Answered: 3 weeks ago

Question

What are the functions of top management?

Answered: 3 weeks ago

Question

8. Providing support during instruction.

Answered: 3 weeks ago