__main__.py 375 B

123456789101112131415
  1. import re
  2. import time
  3. def main():
  4. # print('[{}] Hello world!'.format(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))))
  5. str = '18888888888'
  6. n = len(str)
  7. 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):]
  8. print(new_str)
  9. # 程序入口
  10. if __name__ == '__main__':
  11. main()