第四章 :函数与模块
- 定义函数:
def
- 函数注释文档
def icessun():
# 这也是注释,下面是函数文档注释,描述函数的用途
"""this is function document as docstring"""
vowels=set('aeiou')
word = input("provide a word to search for vowels:")
found=vowels.intersection(set(word))
for vowel in found:
print(vowel)
- 上面这种函数注释可以,下面这种函数注解是针对python3的也行
def search4letters