#!/usr/bin/python3 import sys def FdoC(temp): t = (5/9)* temp-32 return t def CdoF(temp): t = 32+(9/5)*temp return t def strip_d(s): return float(s[:-1]) def logic(s): if s[-1] == 'C': return CdoF(strip_d(s)), 'F' elif s[-1] == 'F': return FdoC(strip_d(s)), 'C' else: return None if __name__ == '__main__': pars = sys.argv[1:] for par in pars: r = logic(par) if r: print(par, '=', str(r[0])+r[1]) else: print(par, '? nie wiem o co chodzi..')