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
antoniya [11.8K]
3 years ago
15

Define a function calculate_range that consumes a temperature and returns a tuple of two numbers, the high and the low. These nu

mbers are calculated as follows:
high = temperature + 20
low = temperature - 30
Then, you will need to call your function once to create two variables today_low and today_high for today's temperature of 70.
Note: Your function will be unit tested against multiple arguments. It is not enough to get the right output for your own test cases, you will need to be able to handle any kind of number.
Note: You are not allowed to use list or tuple indexing.
Note: You may only call your function once.

Computers and Technology
1 answer:
Setler [38]3 years ago
7 0

Answer:

def calculate_range(temperature):

   high = temperature + 20

   low = temperature - 30

   return low, high

today_temp = 70

today_low , today_high = calculate_range(today_temp)

print('Today\'s low = {}\nToday\'s high = {}'.format(today_low, today_high))

Explanation:

The programming language used is python.

The code define the calculate_range function that takes only one parameter temperature.

The function evaluates both high and low temperature and returns a tuple containing both values.

we test the function by creating a temperature variable for today and passing it to the function and this in turn returns two values today_low and today_high.

Your question specifies no need for indexing.

There is a really simple way of unpacking tuple objects, which is used to assign the values returned by the function to separate variables.

<em>today_low , today_high = calculate_range(today_temp)  </em>

Finally, today_low and today_high is printed to the screen.

check the picture to see results of running the code.

You might be interested in
C:\windows\system32\drivers\etc\protocol is an example of a file ________. select one:
monitta

I guess the correct option is letter D.

C:\windows\system32\drivers\etc\protocol is an example of a file path.

5 0
3 years ago
Which tab do you select to change how you see your Word document on screen?
seraphim [82]

Answer:view

Explanation:i just took the test

8 0
3 years ago
Read 2 more answers
Write a single instruction that inverts bits 5 and 6 in the bl register
katrin [286]

The single instruction that can inverts bits 5 and 6 in the bl register is xor bl,1100000b.

<h3>What is single instruction?</h3>

Single Instruction is a term that connote all the data streams are said to be processed though the use of the same compute logic.

Note that in the case above, the single instruction that can inverts bits 5 and 6 in the bl register is xor bl,1100000b.

Learn more about bits from

brainly.com/question/19667078

#SPJ12

5 0
2 years ago
With _____ transmission, both parties in a global network are connected at the same time, as in a phone call
butalik [34]

Answer:

<u>synchronous</u>

Explanation:

During synchronous transmission parties are exchanging messages in real time.

5 0
2 years ago
Why is spyware more dangerous than adware
steposvetlana [31]

To find out how spyware is more dangerous, we must know what each term mean.

Adware is a <em>software that automatically displays advertising material usually on a site that a user goes to</em>.

Spyware is a <em>unwanted software that steals your internet usage data and personal information</em>.

So while Adware can be extremely annoying, it is not as potentially harmful as Spyware, which can steal your personal information and potentially ruin your life.

~

7 0
3 years ago
Other questions:
  • How is a computer component, such as a network card, commonly marked for identification?
    12·1 answer
  • Which of these engine components forms a tight seal between the piston and the cylinder and is necessary for proper engine opera
    13·2 answers
  • Please Do Solve it guys...
    6·1 answer
  • What are some options available in the Spelling and Grammar Checker? Check all that apply. Change and Change All Redo and Repeat
    15·2 answers
  • Help me with this, please. Are vacuum cleaners, Cd players, and telephones considered computers? Do they store any data or proce
    8·2 answers
  • Besides your computer, where else can you find and use an operating system?
    11·1 answer
  • Question:
    14·1 answer
  • What does this mean? And how did I get it?
    12·2 answers
  • Part of the operating system core is responsible for controlling security, managing the file system, and providing a platform fo
    6·1 answer
  • State the base of correct addition of 27 + 6 =34​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!