def say_hi(name: str, age: int) -> str: """ Hi! """ # your code here return "Hi. My name is %s and I'm %d years old" % (name, age)
if __name__ == '__main__': #These "asserts" using only for self-checking and not necessary for auto-testing assert say_hi("Alex", 32) == "Hi. My name is Alex and I'm 32 years old", "First" assert say_hi("Frank", 68) == "Hi. My name is Frank and I'm 68 years old", "Second" print('Done. Time to Check.') ------------------------------------------------------------------------------ 我不太明白 say_hi(name: str, age: int) -> str:这个函数头是什么含义。name: str, age: int 是不是 C 里边的类型声明?-> str:这块完全不理解。