1. 程式人生 > >2.2計算圓柱體的體積.py

2.2計算圓柱體的體積.py

eva eval created put class NPU main __name__ out

# -*- 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