首页后端开发Pythonpython怎么在一行中输入n个数

python怎么在一行中输入n个数

时间2023-06-02 00:30:02发布访客分类Python浏览1019
导读:python怎么在一行中输入n个数?以下代码调试通过:l = [] for i in range(5 : n = input("please enter the number:" l.append(n print('l:',...

python怎么在一行中输入n个数?

以下代码调试通过:

l = [] for i in range(5): n = input("please enter the number:") l.append(n) print('l:', l)

运行效果:

please enter the number:12please enter the number:34please enter the number:56please enter the number:35please enter the number:22l: ['12', '34', '56', '35', '22'] Process finished with exit code 0

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!


若转载请注明出处: python怎么在一行中输入n个数
本文地址: https://pptw.com/jishu/57485.html
个人想从事Python开发 Python中x509是什么?详解x509在Python中的应用

游客 回复需填写必要信息