python如何快速创建一个纯字符的列表

2024-10-24 01:17:50

1、首先打开python的编辑器pycharm

python如何快速创建一个纯字符的列表

3、然后是定义一个函数fast_create

python如何快速创建一个纯字符的列表

5、通过list方法将字符串f1快速变为一个列表。f2=list(f1)

python如何快速创建一个纯字符的列表

7、调用这个函数。fast_create()完整代码如下:#如何快速创建一个啤孩巷柚纯字符的列表def fast_create(): f1="abcdefg" f2=list(f1) print(f2)fast_create()

python如何快速创建一个纯字符的列表
猜你喜欢