英制单位英寸和公制单位厘米互换

value = float(input("请输入您要转换的数值:"))
unit = input("请输入数值的单位:")
if unit == "in" or unit == "英寸":
    value = value / 2.54
    value= round(value,2)
    print(f'{value}cm')
elif unit == "cm" or unit == "厘米":
    value = value * 2.54
    value = round(value, 2)
    print(f'{value}in')
else:
    print("请重新输入单位")