__main__.py 349 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 = '15555555555'
  6. n = len(str)
  7. new_str = 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()