小编Olo*_*ade的帖子

如何将来自用户的许多输入存储在一个集合中

我的目标是以无序方式存储来自用户的许多输入。所以,我决定使用set. 我到目前为止的代码是:

a = input()
b = input()
c = input()
d = input()

all = a, b, c, d
print(set(all))
Run Code Online (Sandbox Code Playgroud)

但是,我不想像input()上面那样重复几次。有没有办法实现这一目标?

python input set python-3.x

4
推荐指数
2
解决办法
335
查看次数

标签 统计

input ×1

python ×1

python-3.x ×1

set ×1