2018年3月7日

摘要: Python课程第二章控制流习题详解 1.使用尽可能多的方法实现list去重方法一:>>> a=[1,2,34,5,6,7,7,8,8,9]>>> set(a)set([1, 2, 5, 6, 7, 8, 9, 34])方法二:>>> a=[2,2,3,3,4,4]>>> b=[2,4]>>> fo 阅读全文

posted @ 2018-03-07 19:30 Ruth_Song 阅读(276) 评论(0) 推荐(0)

摘要: Python课程第十一章正则表达式习题详解 1、匹配一行文字中的所有开头的字母内容>>> import re>>> re.match(r"\D+?","Abc")<_sre.SRE_Match object at 0x0000000001C7D578>>>> re.match(r"\D+?","Ab 阅读全文

posted @ 2018-03-07 19:27 Ruth_Song 阅读(499) 评论(0) 推荐(0)

摘要: Python课程第六章 文件和目录操作习题详解 练习题1:同时读写文件>>> fp=open("D:\A\A.txt",'w')>>> print fp<open file 'D:\\A\\A.txt', mode 'w' at 0x00000000021A6150>>>> print type(f 阅读全文

posted @ 2018-03-07 19:25 Ruth_Song 阅读(784) 评论(0) 推荐(0)

摘要: Python课程第一章初探Python习题详解 1.输入1-127的ascii码并输出对应字符>>> for i in range(0,127)... print i,chr(i)...0 2. 输入a,b,c,d4个整数,计算a+b-c*d的结果>>> a=2>>> b=3>>> c=4>>> d 阅读全文

posted @ 2018-03-07 19:11 Ruth_Song 阅读(1179) 评论(0) 推荐(0)

摘要: Python课程第十一章正则表达式习题详解 1、匹配一行文字中的所有开头的字母内容>>> import re>>> re.match(r"\D+?","Abc")<_sre.SRE_Match object at 0x0000000001C7D578>>>> re.match(r"\D+?","Ab 阅读全文

posted @ 2018-03-07 18:32 Ruth_Song 阅读(116) 评论(0) 推荐(0)

摘要: Python课程第六章 文件和目录操作习题详解 练习题1:同时读写文件>>> fp=open("D:\A\A.txt",'w')>>> print fp<open file 'D:\\A\\A.txt', mode 'w' at 0x00000000021A6150>>>> print type(f 阅读全文

posted @ 2018-03-07 18:30 Ruth_Song 阅读(98) 评论(0) 推荐(0)

摘要: Python课程第二章控制流习题详解 1.使用尽可能多的方法实现list去重方法一:>>> a=[1,2,34,5,6,7,7,8,8,9]>>> set(a)set([1, 2, 5, 6, 7, 8, 9, 34])方法二:>>> a=[2,2,3,3,4,4]>>> b=[2,4]>>> fo 阅读全文

posted @ 2018-03-07 18:24 Ruth_Song 阅读(773) 评论(0) 推荐(0)

摘要: Python课程第一章初探Python习题详解 1.输入1-127的ascii码并输出对应字符>>> for i in range(0,127)... print i,chr(i)...0 2. 输入a,b,c,d4个整数,计算a+b-c*d的结果>>> a=2>>> b=3>>> c=4>>> d 阅读全文

posted @ 2018-03-07 18:18 Ruth_Song 阅读(202) 评论(0) 推荐(0)


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3