answer.
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
diamong [38]
2 years ago
5

Assign max_sum with the greater of num_a and num_b, PLUS the greater of num_y and num_z. Use just one statement. Hint: Call find

_max() twice in an expression.
Sample output with inputs: 5.0 10.0 3.0 7.0
max_sum is: 17.0
1 det find_max(num_1, num_2):
2 max_val = 0.0
3
4 if (num_1 > num_2): # if num1 is greater than num2,
5 max_val = num_1 # then num1 is the maxVal.
6 else: # Otherwise,
7 max_val = num_2 # num2 is the maxVal
8 return max_val
9
10 max_sum = 0.0
11
12 num_a = float(input)
13 num_b = float(input)
14 num_y = float(input)
15 num_z = float(input)
16
17"" Your solution goes here
18
19 print('max_sum is:', max_sum)
Computers and Technology
1 answer:
Gnoma [55]2 years ago
5 0

Answer:

def find_max(num_1, num_2):

   max_val = 0.0

   if (num_1 > num_2): # if num1 is greater than num2,

       max_val = num_1 # then num1 is the maxVal.

   else: # Otherwise,

       max_val = num_2 # num2 is the maxVal

   return max_val

max_sum = 0.0

num_a = float(input())

num_b = float(input())

num_y = float(input())

num_z = float(input())

max_sum = find_max(num_a, num_b) + find_max(num_y, num_z)

print('max_sum is:', max_sum)

Explanation:

I added the missing part. Also, you forgot the put parentheses. I highlighted all.

To find the max_sum, you need to call the find_max twice and sum the result of these. In the first call, use the parameters num_a and num_b (This will give you greater among them). In the second call, use the parameters num_y and num_z (This will again give you greater among them)

You might be interested in
Justin signed a rental agreement for his new condo. How long is his lease? a p e x
kaheart [24]

Answer:

12 months

Explanation:

The options are:

18 months

9 months

6 months

12 months

The lease is being signed for one year, and that is 12 months. And it is being renewed after that through an agreement between the landlord and the tenant. And hence, the correct option here is the 12 months since the lease is legitimate for 12 months only by default.

5 0
2 years ago
Write a function that takes a string like 'one five two' and returns the corresponding integer (in this case, 152). A function j
Lelu [443]

Answer:

see explaination

Explanation:

def words2number(s):

words = s.split()

numbers = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']

result = ""

for word in words:

if word in numbers:

result += str(numbers.index(word))

return result

4 0
2 years ago
Read 2 more answers
The function below takes two arguments, a dictionary called dog_dictionary and a list of dog names (strings) adopted_dog_names.
laiz [17]

Answer:

The solution code is written in Python.

  1. def removeAdoptedDog(dog_dictionary, adopted_dog_names):
  2.    for x in adopted_dog_names:
  3.        del dog_dictionary[x]
  4.    
  5.    return dog_dictionary  
  6. dog_dictionary = {
  7.    "Charlie": "Male",
  8.    "Max" : "Male",
  9.    "Bella" : "Female",
  10.    "Ruby": "Female",
  11.    "Toby": "Male",
  12.    "Coco": "Female",
  13.    "Teddy": "Male"
  14. }
  15. print(dog_dictionary)
  16. adopted_dog_names = {"Ruby", "Teddy"}
  17. print(removeAdoptedDog(dog_dictionary, adopted_dog_names))

Explanation:

Firstly, let's create a function <em>removeAdoptedDog() </em>takes two arguments, <em>dog_dictionary </em>& <em>adopted_dog_names</em> (Line 1)

Within the function, we can use a for-loop to traverse through the <em>adopted_dog_names</em> list and use the individual dog name as the key to remove the adopted dog from <em>dog_dictionary </em>(Line 3). To remove a key from a dictionary, we can use the keyword del.

Next return the updated dog_dictionary (Line 5).

Let's test our function by simply putting some sample records on the <em>dog_dictionary</em> (Line 7 -15)  and two dog names to the <em>adopted_dog_names list</em> (Line 19).

Call the function <em>removeAdoptedDog() </em>by<em> </em>passing the <em>dog_dictionary and adopted_dog_names </em>as arguments. The display result will show the key represented by the<em> adopted_dog_names</em> have been removed from the <em>dog_dictionary </em>(Line 21).

4 0
2 years ago
Enter a formula in cell B10 to return a value of 35000 if the Net Profit After Tax (cell B9) is greater than or equal to 470000
FrozenT [24]

Statement to be written in cell B10 :

IF ( B9 >= 470000, 35000, 1000)

Formula:

IF ( logical_test ,  [value_if_true] ,  [value_if_false] )

Explanation:

  1. logical_test = Net Profit After Tax (cell B9)
  2. value_if_true = 35000

<em>(if the Net Profit After Tax (cell B9) is greater than or equal to 47000 )</em>

<em>     </em>3<em>.</em> value_if_false = 1000

<em>(if the Net Profit After Tax (cell B9) is lesser than 47000 )</em>

Each value should be separated by comma.

6 0
2 years ago
Read 2 more answers
Match each scenario to the absolute value expression that describes it. 1. the distance moved when going backwards five spaces i
soldi70 [24.7K]

Answer:

i don tunderstand the question

Explanation:

4 0
2 years ago
Read 2 more answers
Other questions:
  • A chemical found in the synaptic vesicles , which , when released . has an effect on the next cell is called a?
    10·1 answer
  • Which data type stores images and audio visual clips?
    15·1 answer
  • If a street has a central lane bordered by solid yellow and broken yellow lines, you ________________.
    6·1 answer
  • The spreadsheet below shows the names years in office, and number of terms for five US presidents
    7·2 answers
  • Write a program that first reads in the name of an input file, followed by two strings representing the lower and upper bounds o
    15·2 answers
  • Define a method named roleOf that takes the name of an actor as an argument and returns that actor's role. If the actor is not i
    8·1 answer
  • 63:47 One side in a Transmission Control Protocol (TCP) connection has not been able to properly recover from a series of malfor
    15·1 answer
  • Assume each student is assigned an advisor from a department. Each classroom is assigned a classroom (class# determines Classroo
    14·1 answer
  • Find the sum of the squares of the integers from 1 to MySquare, where MySquare is input by the user. Be sure to check that the u
    6·1 answer
  • Ali has created a small program in Python, but he wants to store his data in a multi-dimensional array. He would like to use adv
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!