Python中正则表达式的使用

一、概述

(一)概念

正则表达式是对字符串操作的一种逻辑公式,就是用事先定义好的一些特定字符、及这些特定字符的组合,组成一个“规则字符串”,这个“规则字符串”用来表达对字符串的一种过滤逻辑。

(二)目的

给定一个正则表达式和另一个字符串,我们可以达到如下的目的:

  1. 给定的字符串是否符合正则表达式的过滤逻辑(称作“匹配”);
    例如:邮箱匹配,电话号码匹配
  2. 爬虫后,可以通过正则表达式,从字符串中获取我们想要的特定部分。
    爬虫中解析 HTML 数据

(三)特点:

1 灵活性、逻辑性和功能性非常的强;
2 可以迅速地用极简单的方式达到字符串的复杂控制。
3 对于刚接触的人来说,比较晦涩难懂。

(四)学习方法

1 做好笔记,不要死记硬背
2 大量练习

python 中通过系统库 re 实现正则表达式的所有功能

二、正则表达式符号

(一)普通字符

  1. 普通字符:一个正则表达式看上去就是一个普通的查找字符串
Str1 = "testing123Test456TESTing789test"
Result1 = re.findall(r'test',Str1)
# 修饰符re.I,使匹配对大小写不敏感
Result2 = re.findall(r'test',Str1,re.I)
print("Result1 = %s,Result2 = %s"%(Result1,Result2))
>>>Result1 = ['test', 'test'],Result2 = ['test', 'Test', 'TEST', 'test']

(二)元字符

  1. 通配符"." --> 匹配除 \n 之外的任何单个字符
# 匹配除 \n 之外的任何单个字符
Str2 = 'testing123\nTESTing456Testing789'
# 匹配 te加2个任意字符
Result3 = re.findall('te..',Str2)
# 匹配任意两个字符
Result4 = re.findall('..',Str2)
# 匹配 t加任意3个字符,忽略大小写
Result5 = re.findall('t...',Str2,re.I)
# re.S,匹配 \n
Result6 = re.findall('..',Str2,re.S)
print("Result3 = %s,Result4 = %s,Result5 = %s"%(Result3,Result4,Result5))
>>>Result3 = ['test'],Result4 = ['te', 'st', 'in', 'g1', '23', 'TE', 'ST', 'in', 'g4', '56', 'Te', 'st', 'in', 'g7', '89'],Result5 = ['test', 'TEST', 'Test']

print("Result6 =",Result6)
>>>Result6 = ['te', 'st', 'in', 'g1', '23', '\nT', 'ES', 'Ti', 'ng', '45', '6T', 'es', 'ti', 'ng', '78']
  1. 脱字符"^" --> 匹配输入字符串的开始位置
# 匹配输入字符串的开始位置
Str3 = 'tEsting\nTEST\nTest\ntest'
Result7 = re.findall('^te',Str3)
# 多行匹配输入字符串的开始位置,且忽略大小写
Result8 = re.findall('^te',Str3,re.I | re.M)
print("Result7 = %s,Result8 = %s"%(Result7,Result8))
>>>Result7 = [],Result8 = ['tE', 'TE', 'Te', 'te']
"\A"匹配字符串开始,他和^的区别是\A只匹配整个字符串的开头,在re.M模式也不会匹配他行的行首
Result9 = re.findall(r"\Ate",Str3)
Result10 = re.findall(r"\Ate",Str3,re.I|re.M)
print("Result9 = %s,Result10 = %s"%(Result9,Result10))
>>>Result9 = [],Result10 = ['tE']
  1. 美元符"$" --> 匹配输入字符串的结束位置
Str4 = "testing\nTEST\nTesting\ntest"
Result11 = re.findall(r'st$',Str4)
Result12 = re.findall(r'st$',Str4,re.I)
Result13 = re.findall(r'st$',Str4,re.I | re.M)
print("Result11 = %s,Result12 = %s,Result13 = %s"%(Result11,Result12,Result13))
>>>Result11 = ['st'],Result12 = ['st'],Result13 = ['ST', 'st']
# "\Z"匹配字符串结束,他和$的区别是\Z只匹配整个字符串的结束,在re.M模式也不会匹配他行的行尾
Result14 = re.findall(r'st\Z',Str4)
Result15 = re.findall(r'st\Z',Str4,re.I)
Result16 = re.findall(r'st\Z',Str4,re.I|re.M)
print("Result14 = %s,Result15 = %s,Result16 = %s"%(Result14,Result15,Result16))
>>>Result14 = ['st'],Result15 = ['st'],Result16 = ['st']
# "\b" 匹配一个单词的边界,也就是此单词和空格间的位置
# "\B" 匹配非单词边界
Str5 = "test ing"
Result17 = re.findall(r"st\b",Str5)
Result18 = re.findall(r"es\B",Str5)
print("Result17 = %s,Result18 = %s"%(Result17,Result18))
>>>Result17 = ['st'],Result18 = ['es']
  1. 重复元字符"*,+,?" -->
    * 匹配前面的子表达式任意次
    + 匹配前面的子表达式一次或多次(至少一次)
    ? 匹配前面的子表达式0次或1次
    {} 控制匹配前面的子表达式次数
Str6 = "a\nab\nabbc\nabBbbc"
Result19 = re.findall('ab*',Str6)
Result20 = re.findall('ab+',Str6)
Result21 = re.findall('ab?',Str6)
print("Result19 = %s,Result20 = %s,Result21 = %s"%(Result19,Result20,Result21))
>>>Result19 = ['a', 'ab', 'abb', 'ab'],Result20 = ['ab', 'abb', 'ab'],Result21 = ['a', 'ab', 'ab', 'ab']

Result22 = re.findall('ab{0,}',Str6)
Result23 = re.findall('ab{1,}',Str6)
Result24 = re.findall('ab{0,1}',Str6)
print("Result22 = %s,Result23 = %s,Result24 = %s"%(Result22,Result23,Result24))
>>>Result22 = ['a', 'ab', 'abb', 'ab'],Result23 = ['ab', 'abb', 'ab'],Result24 = ['a', 'ab', 'ab', 'ab']

Result25 = re.findall("ab{2}",Str6)
Result26 = re.findall('ab{3}',Str6,re.I)
print("Result25 = %s,Result26 = %s"%(Result25,Result26))
>>>Result25 = ['abb'],Result26 = ['abBb']
  1. 选择元字符 “|” --> 表示两个表达式选择一个匹配
# 表示两个表达式选择一个匹配
Str7 = "abc\bcd\cde\tacd\tdcghfd"
# 匹配字符"b"或"d"
Result27 = re.findall("b|d", Str7)
# 匹配"bc"或"ac"或"dc"
Result28 = re.findall("[b|a|d]c",Str7)
print("Result27 = %s,Result28 = %s"%(Result27,Result28))
>>>Result27 = ['b', 'd', 'd', 'd', 'd', 'd'],Result28 = ['bc', 'ac', 'dc']
  1. 字符组 “[]” --> 表示匹配给出的任意字符
# 表示匹配给出的任意字符
Str8 = "test\nTesting\nzoo\naa\nbfds"
# 匹配包含的任意字符
Result29 = re.findall("[eio]",Str8)
# 匹配包含的字符范围
Result30 = re.findall("[e-o]",Str8)
# 回忆脱字符,匹配以[eio]单个字符开头字符
Result31 = re.findall("^[teoa]",Str8,re.M)
print("Result29 = %s,Result30 = %s,Result31 = %s"%(Result29,Result30,Result31))
>>>Result29 = ['e', 'e', 'i', 'o', 'o'],Result30 = ['e', 'e', 'i', 'n', 'g', 'o', 'o', 'f'],Result31 = ['t', 'a']

# 匹配未包含的任意字符
Result32 = re.findall("[^eio]",Str8)
# 匹配未包含的字符范围
Result33 = re.findall("[^e-o]",Str8)
print("Result32 = %s,Result33 = %s"%(Result32,Result33))
>>>Result32 = ['t', 's', 't', '\n', 'T', 's', 't', 'n', 'g', '\n', 'z', '\n', 'a', 'a', '\n', 'b', 'f', 'd', 's'],Result33 = ['t', 's', 't', '\n', 'T', 's', 't', '\n', 'z', '\n', 'a', 'a', '\n', 'b', 'd', 's']

  1. 转义元字符 “” --> 用来匹配元字符本身时的转义
# 用来匹配元字符本身时的转义
Str9 = "1(23)4+567@qq.com"
Result34 = re.findall("\.|\(|\)|\+",Str9)
print("Result34 = %s"%Result34)
>>>Result34 = ['(', ')', '+', '.']
  1. 非贪婪模式
# 在默认情况下,元字符"*","+","{m,n}"会尽可能多的匹配前面的子表达式,这叫贪婪模式
# 在这些元字符后面加上"?"时,表示非贪婪,即尽可能少的匹配前面的子表达式

Str10 = "abcdecfgcC"
# 贪婪模式
Result35 = re.findall("ab.*c",Str10)
# 非贪婪模式
Result36 = re.findall("ab.*?c",Str10)
print("Result35 = %s,Result36 = %s"%(Result35,Result36))
>>>Result35 = ['abcdecfgc'],Result36 = ['abc']

Result37 = re.findall("ab.+c",Str10)
Result38 = re.findall("ab.+?c",Str10)
print('Result37 = %s,Result38 = %s'%(Result37,Result38))
>>>Result37 = ['abcdecfgc'],Result38 = ['abcdec']

Result39 = re.findall("ab.{0,2}",Str10)
Result40 = re.findall("ab.{0,2}?",Str10)
print("Result39 = %s,Result40 = %s"%(Result39,Result40))
>>>Result39 = ['abcd'],Result40 = ['ab']
  1. 分组元字符 “()” -->将括号之间的表达式定义为组(group),并且将匹配这个子表达式的字符返回
#将括号之间的表达式定义为组(group),并且将匹配这个子表达式的字符返回
Str11 = "z\nzood\nfood"
# 不加分组,拿到的引号内正则表达式匹配到的字符
Result41 = re.findall("[z|f]o*",Str11)
# 加上分组,返回的将是引号内正则表达式匹配到的字符中()中的内容。
Result42 = re.findall("[z|f](o*)",Str11)
print("Result41 = %s,Result42 = %s"%(Result41,Result42))
>>>Result41 = ['z', 'zoo', 'foo'],Result42 = ['', 'oo', 'oo']

(三)预定义字符:元字符"\"与某些字符组合在一起表示特定的匹配含义

  1. "\d"匹配单个数字,等价于[0-9]
# 3.1"\d"匹配单个数字,等价于[0-9]
Str12 = """孔籽挺,15650199151

Comments (0) 
February 9, 2013
楼干明,15650199152

楼关林,15650199153"""
Result43 = re.findall("\d",Str12)
Result44 = re.findall("\d+",Str12)
print("Result43 = %s,Result44 = %s"%(Result43,Result44))
>>>Result43 = ['1', '5', '6', '5', '0', '1', '9', '9', '1', '5', '1', '0', '9', '2', '0', '1', '3', '1', '5', '6', '5', '0', '1', '9', '9', '1', '5', '2', '1', '5', '6', '5', '0', '1', '9', '9', '1', '5', '3'],Result44 = ['15650199151', '0', '9', '2013', '15650199152', '15650199153']
  1. "\D"匹配任意单个非数字字符,等价于[^0-9]
# 3.2"\D"匹配任意单个非数字字符,等价于[^0-9]
Result45 = re.findall("\D",Str12)
Result46 = re.findall("\D+",Str12)
print("Result45 = %s,Result46 = %s"%(Result45,Result46))
>>>Result45 = ['孔', '籽', '挺', ',', '\n', '\n', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', ' ', '(', ')', ' ', '\n', 'F', 'e', 'b', 'r', 'u', 'a', 'r', 'y', ' ', ',', ' ', '\n', '楼', '干', '明', ',', '\n', '\n', '楼', '关', '林', ','],Result46 = ['孔籽挺,', '\n\nComments (', ') \nFebruary ', ', ', '\n楼干明,', '\n\n楼关林,']
  1. "\s"匹配任意单个空白符,包括空格,制表符(Tab),换行符
# 3.3"\s"匹配任意单个空白符,包括空格,制表符(Tab),换行符
Result47 = re.findall("\s",Str12)
Result48 = re.findall("\s+",Str12)
print("Result47 = %s,Result48 = %s"%(Result47,Result48))
>>>Result47 = ['\n', '\n', ' ', ' ', '\n', ' ', ' ', '\n', '\n', '\n'],Result48 = ['\n\n', ' ', ' \n', ' ', ' ', '\n', '\n\n']
  1. "\S"匹配任意非空白字符
# 3.4"\S"匹配任意非空白字符
Result49 = re.findall("\S",Str12)
Result50 = re.findall("\S+",Str12)
print("Result49 = %s,Result50 = %s"%(Result49,Result50))
>>>Result49 = ['孔', '籽', '挺', ',', '1', '5', '6', '5', '0', '1', '9', '9', '1', '5', '1', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '(', '0', ')', 'F', 'e', 'b', 'r', 'u', 'a', 'r', 'y', '9', ',', '2', '0', '1', '3', '楼', '干', '明', ',', '1', '5', '6', '5', '0', '1', '9', '9', '1', '5', '2', '楼', '关', '林', ',', '1', '5', '6', '5', '0', '1', '9', '9', '1', '5', '3'],Result50 = ['孔籽挺,15650199151', 'Comments', '(0)', 'February', '9,', '2013', '楼干明,15650199152', '楼关林,15650199153']
  1. "\w"匹配除符号以外的单个字母,数字,下划线或汉字
# 3.5"\w"匹配除符号以外的单个字母,数字,下划线或汉字
Result51 = re.findall("\w",Str12)
Result52 = re.findall("\w+",Str12)
print("Result51 = %s,Result52 = %s"%(Result51,Result52))
>>>Result51 = ['孔', '籽', '挺', '1', '5', '6', '5', '0', '1', '9', '9', '1', '5', '1', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '0', 'F', 'e', 'b', 'r', 'u', 'a', 'r', 'y', '9', '2', '0', '1', '3', '楼', '干', '明', '1', '5', '6', '5', '0', '1', '9', '9', '1', '5', '2', '楼', '关', '林', '1', '5', '6', '5', '0', '1', '9', '9', '1', '5', '3'],Result52 = ['孔籽挺', '15650199151', 'Comments', '0', 'February', '9', '2013', '楼干明', '15650199152', '楼关林', '15650199153']
  1. "\W"匹配非数字,字母和下划线,同[^0-9a-zA-Z_]
# 3.6"\W"匹配非数字,字母和下划线,同[^0-9a-zA-Z_]
Result53 = re.findall("\W+",Str12)
print('Result53 = %s'%Result53)
  1. "[^0-9]"匹配非数字字符
# 3.7"[^0-9]"匹配非数字字符
Result54 = re.findall('[^0-9]',Str12)
print("Result54 = %s"%Result54)

address = "gdf54_3@qq.com"
result = re.findall("^\w*@\w*.com$",address)
print(result)

phone = "13535464553"
result = re.findall("^1",phone)
print(result)

三、采用函数

(一)re.match

  1. 函数使用方法:re.match(pattern,string,flag)
    含义:尝试从字符串的起始位置匹配一个模式,成功返回匹配对象,否则返回 None
    pattern: 正则表达式
    string: 被匹配的字符串
    flag: 标志位,表示匹配模式
    返回结果中包含匹配对象的下标
Str13 = "www.hhxpython.com"
Result55 = re.match("www",Str13)
Result56 = re.match("hhx",Str13)
print("Result55 = %s,Result56 = %s"%(Result55,Result56))
>>>Result55 = <re.Match object; span=(0, 3), match='www'>,Result56 = None
  1. 匹配对象
    match 函数返回一个匹配对象,通过这个对象可以取出匹配到的字符串和分组字符串
Str14 = 'Good good study, Day day up!'
match_obj = re.match('(?P<aa>.*) (?P<bb>.*) (?P<cc>.*),(.*) (.*) (.*)',Str14)
if match_obj:
    print('match_obj.group() =',match_obj.group())    # 返回匹配到的字符串
    print('match_obj.group(1) =',match_obj.group(1))   # 返回对应序号分组字符串 从1开始
    print('match_obj.group(2) =',match_obj.group(2))
    print('match_obj.group(3) =',match_obj.group(3))
    print('match_obj.group(4) =',match_obj.group(4))
    print('match_obj.group("aa") = ',match_obj.group("aa"))
    print('match_obj.group(5) =',match_obj.group(5))
    print('match_obj.group(6) =',match_obj.group(6))

else:
    print('not found')
print('match_obj.groups() =',match_obj.groups())  # 返回分组字符串元组
print('match_obj.groupdict() =',match_obj.groupdict())  # 按照分组名和分组字符串组成字典 (?P<name>pattern)
>>>match_obj.group() = Good good study, Day day up!
>>>match_obj.group(1) = Good
>>>match_obj.group(2) = good
>>>match_obj.group(3) = study
>>>match_obj.group(4) =  Day
>match_obj.group("aa") =  Good
>>>match_obj.group(5) = day
>>>match_obj.group(6) = up!
>>>match_obj.groups() = ('Good', 'good', 'study', ' Day', 'day', 'up!')
>>>match_obj.groupdict() = {'aa': 'Good', 'bb': 'good', 'cc': 'study'}

(二)re.search

  1. re.search(pattern, string, flag)
    含义:扫描整个字符串返回第一个成功的匹配对象
    pattern: 正则表达式
    string: 被匹配的字符串
    flag: 标志位,表示匹配模式
Str15 = 'www.hhxpython.com'
Result57 = re.search('www',Str15)    # 'www' 就是正则表达式,没有元字符表示匹配字符本身
Result58 = re.search('hhx',Str15)
Result59 = re.search('h', Str15)
print('Result57 = %s,Result58 = %s,Result59 = %s'%(Result57,Result58,Result59))
>>>Result57 = <re.Match object; span=(0, 3), match='www'>,Result58 = <re.Match object; span=(4, 7), match='hhx'>,Result59 = <re.Match object; span=(4, 5), match='h'>

(三)re.sub 和 re.subn

  1. re.sub(pattern, repl, string, count=0, flag)
    re.subn(pattern, repl, string, count=0, flag)

1.1 区别:re.sub返回一个被替换的字符串,re.subn返回一个元组,第一个元素是被替换的字符串,第二个元素是被替换的次数
1.2 含义:将表达式匹配到的部分替换为制定字符串,返回替换后的新字符串
1.3 pattern: 正则表达式
1.4 repl: 用来替换的字符串
1.5 string: 被匹配的字符串
1.6 count: 替换次数,默认为 0,表示全部替换
1.7 flags: 标志位,表示匹配模式

phone = '2004-959-559 ### 这是一个国外电话号码##   ### 这是一个国外电话号码##'

# 删除字符串中的python注释
num1 = re.sub('#.*', '', phone)
num2 = re.subn('#.*', '', phone)
print('num1 = %s,num2 = %s'%(num1,num2))
>>>num1 = 2004-959-559 ,num2 = ('2004-959-559 ', 1)

# 删除连接符号 -
num3 = re.sub('-', '', num1)
print('num3 = %s'%(num3))
>>>num3 = 2004959559

(四)re.findall

  1. re.findall(pattern, string, flags=0)
    含义:在字符串中找到正则表达式匹配的所有子串,返回一个列表,匹配失败则返回空列表
    pattern: 正则表达式
    string: 被匹配的字符串
    flags: 标志位,表示匹配模式
line = 'Good good study, Day day up!'

res1 = re.findall('day', line, re.I)
res2 = re.search('day', line, re.I)
res3 = re.match('day', line, re.I)

print('findall方法的结果', res1)
>>>findall方法的结果 ['Day', 'day']
print('search方法的结果', res2.group())
>>>search方法的结果 Day
print('match方法的结果', res3)
>>>match方法的结果 None
  1. match,search,findall 的区别
    match 从头开始匹配,成功返回匹配对象,失败返回 None
    search 只匹配第一个,成功返回匹配对象,失败返回 None
    findall 匹配所有,成功返回所有匹配到的字符串组成的列表,失败返回空列表

(五)re.compile

  1. re.compile(pattern, [flags])
    含义:compile 函数用于编译正则表达式,生成一个正则表达式对象,该对象调用 findall,search,match,sub 等方法
    pattern: 正则表达式
    flags: 标志位,表示匹配模式
    面向对象编程时使用
pattern = re.compile('day', re.I)
res1 = pattern.findall(line)
res2 = pattern.search(line)
res3 = pattern.match(line)
print('findall', res1)
>>>findall ['Day', 'day']
print('search', res2.group())
>>>search Day
print('match', res3)
>>>match None

(六)re.finditer函数

  1. re.finditer(pattern,string,flags = 0)
    pattern 匹配的正则表达式
    string 要匹配的字符串
    flags 标志位,用于控制正则表达式的匹配方式
    功能:与re.findall类似,扫描整个字符串,返回一个迭代器,可以防止找到的数据过多,导致内存使用过大
Str16 = "Sunck is a good man!Sunck is a nice man!Sunck is a handsome man!"
d = re.finditer(r"S.*?!",Str16)
while True:
    try:
        Result = next(d)
        print(Result)
    except StopIteration:
        break
>>>Result = <re.Match object; span=(0, 20), match='Sunck is a good man!'>
>>>Result = <re.Match object; span=(20, 40), match='Sunck is a nice man!'>
>>>Result = <re.Match object; span=(40, 64), match='Sunck is a handsome man!'>

(七)re.split

  1. re.split(pattern,string,flag = 0)
    pattern 匹配的正则表达式
    string 要匹配的字符串。
    maxsplit 分隔次数,maxsplit=1 分隔一次,默认为 0,不限制次数。
    flags 标志位,用于控制正则表达式的匹配方式,如:是否区分大小写,多行匹配等等。参见:正则表达式修饰符 - 可选标志
Str17 = "Sunck is a good man!Sunck is a nice man!Sunck is a handsome man!"
Result60 = re.split('\W+',Str17)
Result61 = re.split('(\W+)',Str17)
Result62 = re.split('\W+',Str17, 1)
Result63 = re.split('f*', 'hello world')  # 对于一个找不到匹配的字符串而言,split 不会对其作出分割
print("Result60 = %s,Result61 = %s,Result62 = %s,Result63 = %s"%(Result60,Result61,Result62,Result63))
>>>Result60 = ['Sunck', 'is', 'a', 'good', 'man', 'Sunck', 'is', 'a', 'nice', 'man', 'Sunck', 'is', 'a', 'handsome', 'man', ''],Result61 = ['Sunck', ' ', 'is', ' ', 'a', ' ', 'good', ' ', 'man', '!', 'Sunck', ' ', 'is', ' ', 'a', ' ', 'nice', ' ', 'man', '!', 'Sunck', ' ', 'is', ' ', 'a', ' ', 'handsome', ' ', 'man', '!', ''],Result62 = ['Sunck', 'is a good man!Sunck is a nice man!Sunck is a handsome man!'],Result63 = ['', 'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '']

(八)re模块调用与re对象调用

Pat = r"^1\d{10}"
PhoneNum = r"15650199151"
ReTelephone = re.compile(Pat)
Result66 = ReTelephone.findall(PhoneNum)
print("Result66 = %s"%Result66)

# re模块调用
# re对象调用
# re.match(pattern,string,flags=0)
# ReTelephone.match(string)
# re.search(pattern,string,flags=0)
# ReTelephone.search(string)
# re.findall(pattern,string,flags=0)
# ReTelephone.findall(string)
# re.finditer(pattern,string,flags=0)
# ReTelephone.finditer(string)
# re.split(pattern,string,maxsplit=0,flags=0)
# ReTelephone.split(string,maxsplit=0)
# re.sub(pattern,repl,string,count=0,flags=0)
# ReTelephone.sub(repl,string,count=0)
# re.subn(pattern,reol,string,count=0,flags=0)
# ReTelephone.subn(repl,string,count=0)

四、匹配模式

(一)re-A(只匹配 ASCII 字符)

(二)re-I(忽略大小写)

(三)re-L(区域设置)

(四)re-M(多行模式)

(五)re-S(. 匹配任何符号)

(六)re-X(详细表达式)

(七)re-U(根据Unicode字符集解析字符,影响\w \W \b \B)

五、练习

Str18 = '/*  part1  */    /*  part2  */'
Result64 = re.findall(r"//*.*?/*/",Str18)
print("Result64 = %s"%Result64)
>>>Result64 = ['/*  part1  */', '/*  part2  */']

Str19 = "Sunck is a good man!Sunck is a nice man!Sunck is a handsome man!"
Result65 = re.findall(r"S.*?!",Str19)
print("Result65 = %s"%Result65)
>>>Result65 = ['Sunck is a good man!', 'Sunck is a nice man!', 'Sunck is a handsome man!']
  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

西门一刀

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值