2.2计算圆柱体的体积.py

Posted WY_记录

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2.2计算圆柱体的体积.py相关的知识,希望对你有一定的参考价值。

# -*- coding: utf-8 -*-
"""
Created on Sun Apr 22 15:55:56 2018

@author: MyPC
"""

def main():
    ‘‘‘
    计算圆柱体的体积.
    
    公式:
    area = radius * radius * π
    volume = area * length
    input:radius,length  
    output:volume
    ‘‘‘
    PI=3.1415926
    radius, length = eval(input("input radius, length:"))
    area = radius * radius * PI
    volume = area * length
    print("The volume is %6.2f :"%(volume))
    
    
if __name__ == "__main__":
    main()

 

以上是关于2.2计算圆柱体的体积.py的主要内容,如果未能解决你的问题,请参考以下文章