# -*- coding: utf-8 -*-
"""
Created on Thu Mar 19 07:34:34 2026

@author: student
"""

def get_tempature():
    print("Podaj jednostke temperatury, gdzie F lub f to Farenheit")
    print("A C lub c to Celcjusz")
    a=input("Jaka skala temperatury?")
    b=float(input("Jaka wartosc?"))
    return a,b

#print(get_tempature())
#get_tempature()
x,y=get_tempature()

def farenheit_to_celcjusz(f):
    c=(5/9)*(f-32)
    return c

def celcjusz_to_farenheit(p):
    d=32+(9/5)*p
    return d

def convert_tempature(jedn,war):
    if jedn=="C" or jedn=="c":
        x=celcjusz_to_farenheit(war)
    elif jedn=="F" or jedn=="f":
        x=farenheit_to_celcjusz(war)
    else:
        print("Błędna jednostka")
        x=None
    return x

#z=convert_tempature(x,y)
#print("wynik=",z)

def convert_tempature2(jedn,war):
    if jedn=="C" or jedn=="c":
        x=celcjusz_to_farenheit(war)
        y="Farenheit"
    elif jedn=="F" or jedn=="f":
        x=farenheit_to_celcjusz(war)
        y="Celcjusz"
    else:
        print("Błędna jednostka")
        x=None
        y="Błędna jednostka"
    return x,y

r,t=convert_tempature2(x,y)
print("wynik=",r,t)

def convert_tempatureB(jedn,war):
    if jedn=="C" or jedn=="c":
        x=celcjusz_to_farenheit(war)
        return x
    elif jedn=="F" or jedn=="f":
        x=farenheit_to_celcjusz(war)
        return x
    else:
        print("Błędna jednostka")
        x=None
        return x