摘要:
一、普通接收参数 import argparse def main(number, other_number): result = number * other_number print(f'The result is {result}') if __name__ == '__main__': pa 阅读全文
摘要:
示例如下: >>> import re >>> match = re.search(r'the phone number is ([\d-]+)', '37: the phone number is 1234-567-890') #\d: 标记任何数字(0-9)。 >>> match.group() 阅读全文
摘要:
简介一下"if ... else ... for" 的用法: >>> word = 'AFTER' >>> print('x' if w.isdigit() else w for w in word) <generator object <genexpr> at 0x105439750> 打印的结果 阅读全文