本文整理匯總了Python中rectangle.Rectangle.calculate_perimeter方法的典型用法代碼示例。如果您正苦於以下問題:Python Rectangle.calculate_perimeter方法的具體用法?Python Rectangle.calculate_perimeter怎麽用?Python Rectangle.calculate_perimeter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rectangle.Rectangle
的用法示例。
在下文中一共展示了Rectangle.calculate_perimeter方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: print
# 需要導入模塊: from rectangle import Rectangle [as 別名]
# 或者: from rectangle.Rectangle import calculate_perimeter [as 別名]
from circle import Circle
from rectangle import Rectangle
from regular import Regular
print("Calculate circunference and area of circle with radius 3")
circle = Circle(3)
circle.calculate_area()
circle.calculate_perimeter()
sides = [2, 4, 2, 4]
print("\nCalculate area and perimeter of rectangle: " + str(sides))
rectangle = Rectangle(sides)
rectangle.calculate_area()
rectangle.calculate_perimeter()
print("\nVerify if last figure is a regular polygon: " + str(sides))
not_regular = Regular(sides)
print(not_regular.valid())
sides = [7,7,7,7,7,7]
print("\nVerify if polygon the following regular : " + str(sides))
regular = Regular(sides)
print(regular.valid())