[ edit ]

def area_of_triangle( bottom, height ):
    area = float()
    area = ( bottom * height ) / 2
    return( area )

【別解】別解というほどではありませんが,1行で書けます

def area_of_triangle( bottom, height ): return ( bottom * height ) / 2

SoftEng: Python/Prog/Example/02/Ex_001a/Digest (last edited 2019-10-09 17:07:38 by TadashiIijima)