Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Run below program in Python and explain 1. F = raw_input(Enter a temperature in Fahrenheit: ) F = float(F) C = 5 / 9. *
Run below program in Python and explain
1.
F = raw_input("Enter a temperature in Fahrenheit: ")
F = float(F)
C = 5 / 9. * (F - 32)
print "%g Fahrenheit = %g Celsius" % (F, C)
2.
import sys
F = float(sys.argv[1])
C = 5 / 9. * (F - 32)
print "%g Fahrenheit = %g Celsius" % (F, C)
3.
import sys
try:
F = float(sys.argv[1])
except IndexError:
print 'You failed to provide a temperature in Fahrenheit '\
'as input on the command line!'
sys.exit(1)# abort
C = 5. / 9 * (F - 32)
print "%g Fahrenheit = %g Celsius" % (F, C)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started