郑毅 6 月之前
父节点
当前提交
f3fc8b7fe9
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      __main__.py

+ 2 - 2
__main__.py

@@ -4,9 +4,9 @@ import time
 
 
 def main():
 def main():
     # print('[{}] Hello world!'.format(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))))
     # print('[{}] Hello world!'.format(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))))
-    str = '15555555555'
+    str = '18888888888'
     n = len(str)
     n = len(str)
-    new_str = str[0:int(n/3)] +re.sub(r'.', '*', str[int(n/3):int(n*2/3)]) + str[int(n*2/3):]
+    new_str = '*' if len(str) == 1 else str[0:int(n/3)] +re.sub(r'.', '*', str[int(n/3):int(n*2/3)]) + str[int(n*2/3):]
     print(new_str)
     print(new_str)