(*args, sep=' ', end='\n', **kwargs)
| 39 | |
| 40 | # 用于记录所有 print 输出的字符串,暂时实现 print 函数的sep和end |
| 41 | def myprint(*args, sep=' ', end='\n', **kwargs): |
| 42 | global all_print_list |
| 43 | output = "" |
| 44 | # 构建输出字符串 |
| 45 | for index, arg in enumerate(args): |
| 46 | if index == len(args) - 1: |
| 47 | output += str(arg) |
| 48 | continue |
| 49 | output += str(arg) + sep |
| 50 | output = output + end |
| 51 | all_print_list.append(output) |
| 52 | # 调用内置的 print 函数打印字符串 |
| 53 | print(*args, sep=sep, end=end, **kwargs) |
| 54 | |
| 55 | |
| 56 | # 发送通知消息 |
no outgoing calls
no test coverage detected