摘要: 字符串切片汇总 [:-1]和[::-1] a='python' b=a[::-1] #nohtyp # 倒序 c=a[::-2] #nhy d=a[:-1] #从位置0到位置-1之前的数 #pytho e=a[:-2] #从位置0到位置-2之前的数 #pyth # 去掉后缀 name = file[ 阅读全文
posted @ 2021-07-09 17:33 该显示昵称已被使用了 阅读(744) 评论(0) 推荐(0) 编辑
摘要: print # 打印进度 for i in range(30): print('\r%d'%i, end='', flush=True) time.sleep(1) # 机器学习打印环境 def update_env(L): while True: env_list = ['T']+ ['-'] * 阅读全文
posted @ 2021-07-09 17:32 该显示昵称已被使用了 阅读(87) 评论(0) 推荐(0) 编辑