def convert_SI(val, unit_in, unit_out):
SI = {'ml':0.000001, 'l':0.001, 'c-m':1.0, 'cc':0.000001, 'u-lg':0.00378541, 'u-lq':0.000946353, 'u-lp':0.000473176, 'u-lc':0.00024, 'f-ou':0.000029574, 'u-ts':0.000014787, 'u-ts2':0.000004928, 'i-g':0.00454609, 'i-q':0.00113652, 'i-p':0.000568261, 'i-c':0.000284131, 'i-ts':0.000017758, 'i-ts2':0.000005919, 'c-f':0.0283168, 'c-i':0.000016387}
return (float(val * SI[unit_in] / SI[unit_out]))
def temp():
tsg = ['ml','l','cc','c-m','u-lg','u-lq','u-lp','u-lc','f-ou','u-ts','u-ts2','i-g','i-q','i-p','i-c','i-ts','i-ts2','c-f','c-i']
try:
print("======================== Complete Volume Converter ========================")
print("\n\n-------------------------------------------------------------")
print("###### LIST OF AVAILABLE UNITS OF VOLUME ######")
print("-------------------------------------------------------------\n\n")
print("=> MILLI-LITRES/CUBIC-CENTIMETRES -- ml/cc [CODE]")
print("=> LITRES -- l [CODE]")
print("=> CUBIC-METRES -- c-m [CODE]")
print("=> US-LIQUID GALLON -- u-lg [CODE]")
print("=> US-LIQUID QUART -- u-lq [CODE]")
print("=> US-LIQUID PINT -- u-lp [CODE]")
print("=> US-LEGAL CUP -- u-lc [CODE]")
print("=> FLUID OUNCE -- f-ou [CODE]")
print("=> US-TABLESPOON -- u-ts [CODE]")
print("=> US-TEASPOON -- u-ts2 [CODE]")
print("=> IMPERIAL GALLON -- i-g [CODE]")
print("=> IMPERIAL QUART -- i-q [CODE]")
print("=> IMPERIAL PINT -- i-p [CODE]")
print("=> IMPERIAL CUP -- i-c [CODE]")
print("=> IMPERIAL TABLESPOON -- i-ts [CODE]")
print("=> IMPERIAL TEASPOON -- i-ts2 [CODE]")
print("=> CUBIC-FOOT -- c-f [CODE]")
print("=> CUBIC-INCH -- c-i [CODE]")
print("\n-------------------------------------------------------------")
print("*************************************************************")
print("-------------------------------------------------------------")
print("\n\nV Enter here V")
unit_in = input("\nFROM UNIT [CODE]-- \t")
if unit_in not in tsg:
print("ENTER THE CODE CORRECTLY!")
temp()
unit_out = input("TO UNIT [CODE]-- \t")
if unit_out not in tsg:
print("ENTER THE CODE CORRECTLY!")
temp()
amount = float(input("ENTER THE AMOUNT --\t"))
res = (convert_SI(amount, unit_in, unit_out))
print("\n ------+++------------+++------")
print("{} {} = {} {}".format(amount, unit_in, res, unit_out))
print("------+++------------+++------\n")
except:
print("\nENTER THE AMOUNT CORRECTLY!!")
temp()
U = input("\nDO YOU WANT TO TRY AGAIN? \nPLEASE ENTER -- [YES/Y OR NO/N] :--\t").lower()
if (U == 'yes' or U == 'y'):
temp()
else:
print("\n\n______THANK YOU______")
exit()
temp()
没有合适的资源?快使用搜索试试~ 我知道了~
Python 中的完整音量转换器应用程序源代码
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共1个文件
py:1个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 192 浏览量
2024-02-29
22:38:05
上传
评论
收藏 1KB ZIP 举报
温馨提示
Complete Volume Converter App 仅使用 Python 编程语言创建。该系统设计为用户友好型,可以轻松应用于您工作的任何系统。在 Python IDE 中打开 Python 脚本后,项目将自动启动。该应用程序的目的是帮助学生转换涉及体积的测量值。这个简单的转换器应用程序可以使您的转换更快、更可靠。您可以使用此应用程序从多种转换中进行选择,例如厘米、升等。 Python 中的完整卷转换器应用程序源代码安装指南 首先,您需要下载并安装Python IDLE,这是链接“https://www.python.org/downloads/”。 下载此站点的源代码。 找到并解压缩 zip 文件。 打开解压缩的文件夹 找到 py 文件。 然后通过 python IDLE 或任何支持 python 语言的 IDE 打开文件。 运行 py 文件以启动程序。
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 1 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/4eddbcfa248a4cceaeed1167955c58d5_mzgxinhua.jpg!1)
![avatar-vip](https://csdnimg.cn/release/downloadcmsfe/public/img/user-vip.1c89f3c5.png)
新华
- 粉丝: 1w+
- 资源: 629
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)