-
Notifications
You must be signed in to change notification settings - Fork 10
/
temperature_utils.py
34 lines (25 loc) · 1.51 KB
/
temperature_utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from typing import Iterable, Tuple
def convert_to_celsius(fahrenheit_temp: float) -> float:
"""
Given a float representing a temperature in fahrenheit, return the corresponding value in celsius.
:param fahrenheit_temp: A float representing a temperature in fahrenheit
:return: A float representing the corresponding value of the fahrenheit_temp parameter in celsius
"""
pass # remove pass statement and implement me
def convert_to_fahrenheit(celsius_temp: float) -> int:
"""
Given a float representing a temperature in celsius, return the corresponding value in fahrenheit.
:param celsius_temp: A float representing a temperature in celsius
:return: A float representing the corresponding value of the celsius_temp parameter in fahrenheit
"""
pass # remove pass statement and implement me
def temperature_tuple(temperatures: Iterable, input_unit_of_measurement: str) -> Tuple[Tuple[float, float]]:
"""
Given a tuple or a list of temperatures, this function returns a tuple of tuples.
Each tuple contains two values. The first is the value of the temperatures parameter. The second is the the value of
the first converted to the unit of measurement specified in the input_unit_of_measurement parameter.
:param temperatures: An iterable containing temperatures
:param input_unit_of_measurement: The unit a measure to use to convert the values in the temperatures parameter
:return: A tuple of tuples
"""
pass # remove pass statement and implement me