Friday 10/3

Converter

2 Fridays ago, made this:

it’s supposed to convert kg to pounds and pounds to kg, today I started upgrading it to allow it to convert more than one form of units, it is NOT compelete:

I finished my chapter 3 on Project stem, that took me the whole of the first period, I also wasted so much time checking videos and switching them because they didn’t seem to work for me:

#This is my code so far:
choice = input("what unit will you convert: (W)eight or (T)emperature")

if choice == str("T"):
celsius = float(input("Enter temperature in Celsius: "))

fahrenheit = (celsius * 9 / 5) + 32

print(f"{celsius}°C is equal to {fahrenheit:.2f}°F")




if choice == str("W"):
    Weight = int(input("weight: "))
    unit = input("(k)g or (L)bs? ")
    if unit.upper() == "K":
        converted = Weight / 0.45
        print(f"Weight in lbs: " + str(converted))
    else:
        converted = Weight * 0.45
        print(f"weight in kgs: " + str(converted))

else:
    print("Invalid")

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top