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
You have one ip address provided from your isp with a /30 mask. However, you have 300 users that need to access the internet. Wh
creativ13 [48]

Answer:

a. PAT

Explanation:

20.You have one IP address provided from your ISP with a /30 mask. However, you have 300 users that need toaccess the Internet. What technology will you use to implement a solution?a.PATb.VPNc.DNSd.VLANs

4 0
3 years ago
There are three required elements needed to connect to the internet: hardware, web browser, and __________.
malfutka [58]

Yes the answer is D.internet service.

7 0
3 years ago
Read 2 more answers
The Domain Name Service is what translates human-readable domain names into IP addresses that computers and routers understandA.
Mars2501 [29]

Answer:

True

Explanation:

A Domain Name Service comprises of computer servers that carries a database of public IP addresses and their related human-readable domain names/hostnames, it receives query as hostnames and helps to translates those human-readable domain names/hostnames into IP addresses that computers and routers understand.

5 0
4 years ago
A virus that is embedded in the automatically executing scipts commonly found in word processors, spreadsheets, and database app
schepotkina [342]

Answer:

macro virus

Explanation:

Macro virus -

A micro virus is written in a micro language  , where the programming language is present in the application of software like the powerpoint , excel , microsoft office , word processor , etc.

These virus gets activated as soon as the file is opened and then the virus starts to spread all over the system .

The virus may be send via email , and as soon as the file is opened , the macro virus gets activated.

Hence, from the given information of the question,

The correct term is macro virus.

6 0
4 years ago
Read 2 more answers
On an LG phone, will a factory reset stop a message from sending/cancel a message? ​
daser333 [38]

Answer:

No

Explanation:

Your SIM card will still have the information that you're service provider needs to stop allow you to text

3 0
3 years ago
Other questions:
  • Approximately what percent of desktop PCs are used for work-related purposes?
    13·2 answers
  • ____________ is a widely accepted international best practices framework for implementing information systems security.
    12·1 answer
  • 1. What are the built-in operations on classes?
    8·1 answer
  • What does a computer need from people in order to solve problems effectively?
    9·1 answer
  • I love the brainly update guys! :)
    5·2 answers
  • Match each term in the second column with its correct definition in the first column. Write the letter of the term on the blank
    12·1 answer
  • Functionality testing is primarily used with ____________. firewall protection software development hardening servers server tes
    8·1 answer
  • I was just called a man in a wig ugh <br><br> Any tips for doxxing someone?
    6·1 answer
  • 1. Encrypt this binary string into cipher text: 110000. Include in your answer the formula the
    10·1 answer
  • "You have created a Word document named apple.docx using Microsoft Word. What type of a file is apple.docx ? Select all that app
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!