Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

créer des variable dynamiques python

for i in range(0, 9):
    globals()[f"my_variable{i}"] = f"Hello from variable number {i}!"


print(my_variable3)
# Hello from variable number 3!
 
PREVIOUS NEXT
Tagged: #des #variable #dynamiques #python
ADD COMMENT
Topic
Name
2+6 =