【问题标题】:How to have a list take user input in python 3?如何让列表在 python 3 中接受用户输入?
【发布时间】:2021-02-04 16:37:35
【问题描述】:

enter image description here

我尝试了不同的方法,但仍然没有想出解决方案。

【问题讨论】:

  • 请专门提供您的代码以便于复制并准确指定错误以便我们提供帮助。

标签: python-3.x list


【解决方案1】:

我是 python 的初学者。我试过这个,我不知道这是否是你正在寻找的,或者是否有更好的方法。

test = [1,2,3]
userinput = input(str("insert here:"))
test.append(userinput)
print(test)```

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-10
    • 2017-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多