You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SimpleCalculator/main.py

9 lines
397 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

from calculator import AdvancedCalculator
if __name__ == "__main__":
calc = AdvancedCalculator()
print("基础运算测试:", calc.add(10, 5), calc.divide(10, 2))
print("幂运算测试:", calc.power(2, 3))
print("平方根测试:", calc.sqrt(16))
print("阶乘测试:", calc.factorial(5))
print("质数判断测试13是质数吗", calc.is_prime(13))