Python语言基础与应用-北京大学-陈斌-P32-31-计算和控制流-上机练习:创建并调用函数-字符集合的并集-上机代码
Python�index.php/tags-41973.html" class="superseo">�言基础与应用-北京大学-陈斌-P32-31-计算和控制流-上机练习:创建并调用函数-字符集合的并集-上机代码
本文环境: win10 + Thonny4.1.4
# 函数训练字符集合的并集 def my_union(str1,str2): list1 = [] list2 = [] i = 0 while i结果:
>>> %Run 111111.py 请输入字符串1:abcdefg 请输入字符串2:efghijk {'e', 'h', 'c', 'j', 'k', 'b', 'f', 'i', 'd', 'a', 'g'} >>>
The End