inchmm换算器:轻松转换英寸和毫米

admin 头条 1

以下是一个简单的英寸和毫米之间的换算器,使用Python编写:

```python

def inch_to_mm(inches):

return inches 25.4

def mm_to_inch(mm):

return mm / 25.4

def main():

while True:

print("n选择转换方向:")

print("1. 英寸转毫米")

print("2. 毫米转英寸")

print("3. 退出")

choice = input("请输入选项(1/2/3):")

if choice == '1':

inches = float(input("请输入英寸数:"))

print(f"{inches