1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kobusy [5.1K]
3 years ago
12

Write a function min that has two str parameters and returns the smallest. (Smallest in the sense of coming first alphabetically

, not in the sense of "shortest".)
Mathematics
1 answer:
matrenka [14]3 years ago
7 0

Answer:

The function written in python is as follows

def min(str1,str2):

     if str1 < str2:

           return str1

     else:

           return str2

Step-by-step explanation:

This line defines the function min, along with two parameters str1 and str2

def min(str1,str2):

This line checks if str1 is less than str2

if str1 < str2:

If yes, the function returns str1

 return str1

If otherwise,

else:

The function returns str2

 return str2

Take for instance

str1 = "abc"

str2 = "cba"

The function will return str1 because str1 is less than str2 in the sense that the first letter of str1 (a) is less than the first letter of str2 (c)

You might be interested in
A merchant sold a pen for $6.90 ,thereby making a profit of 15% on her cost calculate the cost of the pen to the merchant to the
NeTakaya
So you know the merchant made a 15% profit on the pen, so she bought it for a cheaper price. To find the cost of the pen before you have to take the price now, $6.90 and times it by 85%. You do 85% because you subtract the 15% she saved from 100% and you get 85%. So 6.90x.85= 5.865 which rounds to $5.87
7 0
3 years ago
A newborn weighs 8 pounds, 5 ounces. There are 453.59 grams per pound. What is the infant's weight in grams?
Nadya [2.5K]
Convert from Oz and Lbs.

1 Pound = 453.59237 Grams

1 Ounce = 28.3495231 Grams

3628.73896 for Lbs

141.7476155 for Oz

Add them, and you get:

3770.4865755

I didn't know if you needed rounding - it was classified as college.

Hope this helped, and have a good day!





5 0
3 years ago
The average national utility price is $270.48. Over a 6-month period, what is the average utility price in Orlando? How does thi
Svetllana [295]

Answer:

B.

Step-by-step explanation:

6 0
3 years ago
If the area of a circle measures 16 pi cm2, what is the circumference of the circle in terms of pi
Fiesta28 [93]

Answer: 8 pi

Step-by-step explanation: So we know that area of a circle is pi times r^2 so if we reverse that formula it would be square root of 16 pi which would be 4 pi and divide by pi so the radius is 4. And we know that the formula for circumference is 2 times pi times r, so 2 times 4 times pi is 8 pi. 8 pi is the cIrcumference! :)

7 0
3 years ago
Can somebody help me with this question please ?
inysia [295]

Answer: No.

Step-by-step explanation: g should also be factored out. 10g(a - 3z).

4 0
3 years ago
Other questions:
  • Find the unit rate by using WKU. David drove 135 miles in 3 hours.
    14·1 answer
  • 3.0188 rounded to the nearest thousandths
    6·1 answer
  • A coffee shop uses two different-sized bins to store coffee beans. The volume of the smaller bin is r cubic inches and the volum
    5·1 answer
  • Solve by completing the square. x^2 + 4x – 1= 0
    11·1 answer
  • Write a ratio in simplest form that compare the number of baseball cards to the total number of card
    11·2 answers
  • If l is Parallel to m, find the value of y
    14·2 answers
  • Help me please I am really struggling ASAP
    11·1 answer
  • The equation of horizontal line passing through (3,-4) is​
    6·1 answer
  • How do you solve A=πr² for r?
    13·1 answer
  • At Polly's Closet, 1/2 of the clothes are white and another 1/3 are black. What fraction of the clothes are either black or whit
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!