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.