Using a script (code) file, write the following functions: -Write the definition of a function that take
Question:
Using a script (code) file, write the following functions:
-Write the definition of a function that take one number, that represents a temperature in Fahrenheit and prints the equivalent temperature in degrees Celsius.
-Write the definition of another function that takes one number, that represents speed in miles/hour and prints the equivalent speed in meters/second.
-Write the definition of a function named main. It takes no input, hence empty parenthesis, and does the following:
- prints Enter 1 to convert Fahrenheit temperature to Celsius
- prints on the next line, Enter 2 to convert speed from miles per hour to meters per second.
-take the input, lets call this main input, and if it is 1, get one input then call the function of step 1 and pass it the input.
- if main input is 2, get one more input and call the function of step 2.
- if main input is neither 1 or 2, print an error message.
-After you complete the definition of the function main, write a statement to call main.
Example of what the code should look like:
def func1(x):
print(x)
def func2(y):
print(y)
print(' ')
print(y)
def main():
func1('hello world')
func2('hello again')
#below we start all the action
main()