
def search4vowels(phrase: str) -> set:
"""phrase
内の母音の集合を返す。
"""
return set('aeiou').intersection(set(phrase))
def search4letters(phrase: str, letters: str='aeiou') -> set:
"""phrase
内の
letters
の集合を返す。
"""
return set(letters).intersection(set(phrase))
from setuptools import setup
setup(
name='vsearch',
version='1.0',
description='The Head First Python Search Tools',
author='HF Python 2e',
author_email='hfpy2e@gmail.com',
url='headfirstlabs.com',
py_modules=['vsearch'],
)
def double(arg):
print('
実行前:
', arg)
arg = arg * 2
print('
実行後:
', arg)
def change(arg: list):
print('
実行前:
', arg)
arg.append('
さらなるデータ
')
print('
実行後:
', arg)
コード
4
章のコード
vsearch.py
モジュールのコード。