(1)题目:
(MyTriangle 模块)创建一个名叫 MyTriangle 的模块,它包含下面两个函数 #Returns true if the sum of any two sides isgreater than the third side. def isValid(sidel,side2,side3):
# Returns the area of the triangle. def area(sidel,side2,side3):
编写一个测试程序,读入三角形三边的值,若输人有效则计算面积。否则,显示输入无效计算三角形面积的公式在编程题2.14中给出。下面是一些示例运行。
(2)题目:
(反向显示一个整数)编写下面的函数,反向显示一个整数) def reverse(number): 例如:reserse(3456)显示6543。编写一个测试程序,提示用户输入一个整数,然后显示它的反向数。