1. python 字符串多行输入
while True:
try:
inputLine = raw_input()
except:
break
2. 一行多个整数
n,s = map(int,input().split())3. 输入数组(一行)
nums = [int(x) for x in input().split()]
本文介绍了Python中几种实用的输入方法,包括多行字符串输入、一行内多个整数的读取及数组输入等,适合初学者快速掌握Python基本输入操作。
1. python 字符串多行输入
while True:
try:
inputLine = raw_input()
except:
break
2. 一行多个整数
n,s = map(int,input().split())3. 输入数组(一行)
nums = [int(x) for x in input().split()]
351
1308
302
443

被折叠的 条评论
为什么被折叠?