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
Find the global maximum and global minimum values (if they exist) of x 2 + y 2 in the region x + y = 1. If there is no global ma
Grace [21]

Given that x+y=1, we have y=1-x, so that

f(x,y)=x^2+y^2\iff g(x)=x^2+(1-x)^2

Take the derivative and find the critical points of g:

g'(x)=2x-2(1-x)=4x-2=0\implies x=\dfrac12

Take the second derivative and evaluate it at the critical point:

g''(x)=4>0

Since g'' is positive for all x, the critical point is a minimum.

At the critical point, we get the minimum value g\left(\frac12\right)=f\left(\frac12,\frac12\right)=\frac12.

5 0
3 years ago
Tell me what -28 + (-80) equals please i need help
adoni [48]
It’s -108. Hope this helps you out. Let me know if you need something else
7 0
3 years ago
Find the probability.
kvv77 [185]

Answer:

7/36

Step-by-step explanation:

1 die has 6 faces

When two dice are rolled, the total number of outcomes

= 6 × 6 = 36

The Probability of having(5) =

(1 & 4), (2 & 3) , ( 3 & 2), (4 & 1)

= 4

The probability of having (10) =

(5 & 5), (4 & 6) , ( 6 & 4)

= 3

The probability that the score on the dice is either 5 or 10.

P(5) + P(10)

= 4/36 + 3/36

= 7/36

8 0
2 years ago
Why does it say this am i supposed to be ranked up or what?
tatiyna

Answer:

idk that's weird ( I'm just trying to get more points)

4 0
3 years ago
How do you find the area of this figure?
loris [4]

Answer:

seis CM para 10 yd por eso

8 0
2 years ago
Other questions:
  • Variable y varies directly with variable x, and y = 45 when x = 9.
    8·2 answers
  • Write the place value of the underlined digit round each number to the place of the underlined digit.
    11·1 answer
  • Why do the inequality signs stay the same in the last two steps of exercise 1
    12·2 answers
  • How do you find the area of a circle and what is the formula for it
    10·2 answers
  • 2x &gt; -6 and x – 4 ≤ 3
    12·1 answer
  • I need help with math test!!!
    9·1 answer
  • Find the 15th term of the geometric sequence 1, -4, 16, ...1,−4,16,
    5·1 answer
  • In FGH, the measure of H=90°, HF = 91 feet, and GH = 50 feet. Find the measure of F to the nearest degree.​
    13·2 answers
  • 2. How many ounces of yeast will you need to make 30 rolls?
    12·1 answer
  • Pauley graphs the change in temperature of a glass of hot tea over time. he sees that the function appears to decrease quickly a
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!