In: Computer Science
Python 3
Below is an example of how the code should look like:
#Sample Code by Student Name
#Created on Some Date
#Last Edit on Another Date
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()
Remember to add comments, and that style and best practices will
counts towards the points.
A program that just "works" is not a guarantee for full credit.
Program Code Screenshot:
Sample Output
Program Code to Copy
def func1(f):
#Convert Fahrenheit to Degrees
print(str(f)+'F is '+str((f-32)*100/180)+'C')
def func2(m):
#Convert miles to meter per second
print(str(m)+'miles per hour is '+str(m*1.6*5/18)+' meter per
second')
def main():
print('Enter 1 to convert Fahrenheit temperature to Celsius')
print('Enter 2 to convert speed from miles per hour to meters per
second')
#Prompt for choice
c = int(input())
if c is 1:
#Prompt for fahrenheit
f = float(input())
func1(f)
elif c is 2:
#Prompt for miles per hour
m = float(input())
func2(m)
else:
print('Invalid input')
main()