def solution(n: int = 600851475143) -> int:#->int后面的冒号是函数定义def的用法
## ->int是python返回类型的注解,参数后面的冒号是注解信息
#这句话的意思即为定义了一个函数名为solution,其中给定一个参数n,n为600851475143
#solution这个函数的返回值为int
try:
n = int(n)
except (TypeError, ValueError):
raise TypeError("Parameter n must be int or passive of cast to int.")
#raise语法:raise [Exception [, args [, traceback]]]语句中TypeError是异常的 类型
#括号里面是错误信息
if n <= 0:
raise ValueError("Parameter n must be greater or equal to one.")