<filename>Fahrenheit_celsius.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 17 11:26:41 2019

@author: install
"""

import sys
if (len(sys.argv)!=3):
   print("""Usage: python Fahrenheit_celsius.py {F, C} temp converts from Fahrenheit to Celsius or vice versa. temp must be a number.""")
   sys.exit(1)

if sys.argv[1]=="F":
    temp = (int(sys.argv[2]) - 32)*5/9
    print(temp, " °C")

if sys.argv[1] == "C":
    temp = int(sys.argv[2]) *9/5 + 32
    print(temp, " °F")

<filename>Fahrenheit_celsius.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 17 11:26:41 2019

@author: install
"""

import sys
if (len(sys.argv)!=3):
   print("""Usage: python Fahrenheit_celsius.py {F, C} temp converts from Fahrenheit to Celsius or vice versa. temp must be a number.""")
   sys.exit(1)

if sys.argv[1]=="F":
    temp = (int(sys.argv[2]) - 32)*5/9
    print(temp, " °C")

if sys.argv[1] == "C":
    temp = int(sys.argv[2]) *9/5 + 32
    print(temp, " °F")

# -*- coding: utf-8 -*- Created on Thu Oct 17 11:26:41 2019  @author: install Usage: python Fahrenheit_celsius.py {F, C} temp converts from Fahrenheit to Celsius or vice versa. temp must be a number.