#!/usr/bin/python3 a = 21 b = 10 c = 0 c = a + b print ("1 - c 的值为:", c) c = a - b print ("2 - c 的值为:", c) c = a * b print ("3 - c 的值为:", c) c = a / b print ("4 - c 的值为:", c) c = a % b print ("5 - c 的值为:",…
import re print(re.match('www', 'www.runoob.com').span()) # 在起始位置匹配 print(re.match('com', 'www.runoob.com')) # 不在起始位置匹配 import re line = "Cats are smarter than dogs" # .* 表示任意匹配除换行符(\n.\r)之外的任何单个或多个字符 matchObj = re.match( r'(.*) are (.*?) .*', l…