📜  如何在 python 代码示例中创建动态变量名

📅  最后修改于: 2022-03-11 14:45:12.928000             🧑  作者: Mango

代码示例2
for x in range(0, 9):
    globals()['string%s' % x] = 'Hello'
# string0 = 'Hello', string1 = 'Hello' ... string8 = 'Hello'