Skip to content

Python code snippet – How to change the name of a variable in a loop ?

for i in range(3):
    locals()["group"+str(i)] = self.getGroup(selected, header+i)
See also  CSS code snippet - How to change highlight color on website?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.