1. Python的功能一,计算器功能:
>>> 2+2
4
>>> # This is a comment
... 2+2
4
>>> 2+2 # and a comment on the same line as code
4
>>> (50-5*6)/4
5.0
>>> 8/5 # Fractions aren't lost when dividing integers
1.6
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/86824/viewspace-671547/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/86824/viewspace-671547/
本文介绍了Python作为一款强大的编程语言在基础计算器功能方面的应用,通过几个简单的示例展示了如何使用Python进行基本的数学运算,包括整数加减乘除以及简单的分数计算。这些示例有助于初学者快速掌握Python的基本语法。
338

被折叠的 条评论
为什么被折叠?



