题解 | #生成列表#

生成列表

https://www.nowcoder.com/practice/349954d559e1494ba5f83e42388ba8ea

定义接收变量与列表变量,在接收输入的同时,将字符串按照空格进行分割

name = input().split(" ")
name_list = list()

利用for循环将接收到的字符串写入空列表并打印

for i in name:
    name_list.append(i)
print(name_list)
全部评论

相关推荐

喵_coding:项目太烂了外卖+点评啊 而且寒假实习差不多到时候了 hc没多少了 要实在想要找那只能投投大厂试试了
点赞 评论 收藏
分享
头像
2025-12-27 13:01
三峡大学 C++
点赞 评论 收藏
分享
评论
38
2
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务