题解 | #读入字符串#

读入字符串

https://www.nowcoder.com/practice/db20629d4e4345c980437b38e92f8ee2

s=input()
print(s)

若输入一个数用input(),还可以限定类型,例如int(input())

若输入两个数用a,b=map(int,input().split())

map函数用来转为int类型

split用来分隔成两部分

多个输入用s=list(map(int,input().split))用列表存储

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务