本文介绍了你如何在Python中转换英寸和密斯之间的距离?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我必须为我的任务做这个,但我需要帮助!我已经尝试输入我的信但是它不起作用请告诉我我做错了什么或者做不出来似乎无法弄明白。 这个程序将转换距离(英寸/英里) Ehter(I)将英寸转换为里程 输入(M)将里程转换为英寸 输入选择:我 输入转换距离:115 115.0英寸相当于0.00181502英里。然后 此程序将转换距离(英寸/英里) 输入(I)转换为里程 输入(M)将里程转换为英寸 输入选择:N 请输入'我'或'M':R 我尝试了什么: 这就是我所做的全部 tterinteger =我 d_ft = int(输入(输入(I)将英寸转换为英里:)) d_miles = d_ft / 5280.0 d_yards = d_ft / 3.0 print(以英寸为单位的距离为%i英寸。 %d_inches print(码距离是%.2f码。%d_yards) print(以英里为单位的距离是%.2英里。 %d_miles) 12345678 解决方案 Hi I have to do this for my assignment but I need help!. I have tried entering the letter I but it doesn't work please tell me what am doing wrong or didn't do cant seem to figure it out.This program will convert distances (Inches/Miles)Ehter (I) to convert Inches to milesEnter (M) to convert Miles to InchesEnter selection: IEnter distance to convert: 115115.0 Inches equals 0.00181502 Miles. thenThis program will convert distances (inches/miles)enter (I) to convert to Milesenter (M) to convert miles to inchesenter selection: NPlease enter 'I' or 'M': RWhat I have tried:this is all I have donetterinteger = Id_ft = int(input("Enter (I) to convert Inches to Miles: "))d_miles = d_ft / 5280.0d_yards = d_ft / 3.0print("The distance in inches is %i inches." % d_inches)print("The distance in yards is %.2f yards." % d_yards)print("The distance in miles is %.2f miles." % d_miles)12345678 解决方案 这篇关于你如何在Python中转换英寸和密斯之间的距离?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
11-02 20:20