码迷,mamicode.com
首页 > 编程语言 > 详细

python 输入输出

时间:2017-08-31 23:12:19      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:color   split   logs   stdin   python3   put   lin   lis   输入   

 1 if __name__==__main__:
 2     # ff=input()
 3     # print(type(ff))#<class ‘str‘>
 4     # a=int(input())
 5     # a1=raw_input()#python3 舍弃,python2还用
 6     line=sys.stdin.readline()
 7     line1=line.strip(\n)
 8     # line1 = sys.stdin.readline().strip(‘\n‘)
 9     # line2 = input()
10     # input("hhhh")
11     line2=[int(i) for i in input("请输入:\n").split( )]
12     # line2=input().split(‘ ‘)#[‘1‘, ‘2‘]
13     print(line1,line2)
14     print(type(line1),type(line2))#<class ‘str‘> <class ‘list‘>
15     print(len(line1), len(line2))#4 2
16     a=[int(n) for n in sys.stdin.readline().strip(\n).split( )]
17     print(a)
18     print(type(a))
19     c=[[0 for i in range(3)] for i in range(3)]
20     print(c)
21     # b=[int(i) for i in sys.stdin.readline().split(‘ ‘)]

 

python 输入输出

标签:color   split   logs   stdin   python3   put   lin   lis   输入   

原文地址:http://www.cnblogs.com/smuxiaolei/p/7460750.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!