变量名动态命名和调用

for i in range(3):
exec('saved_path_{} = "7_26_DPPO_step_5_piece_6_{}"'.format(i, 15+2*i))
for i in range(3):
exec('print(saved_path_{}, end=" ")'.format(i))
posted @ 2019-03-31 15:46  LIN_KID  阅读(371)  评论(0编辑  收藏  举报