Search
 
SCRIPT & CODE EXAMPLE
 

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!
Comment

PREVIOUS NEXT
Code Example
Python :: python sqrt import 
Python :: distance euc of two arrays python 
Python :: pandas_datareader 
Python :: python access index in for loop 
Python :: python print to file 
Python :: hbox(children=(floatprogress(value= 
Python :: no python 3.10 installation was detected 
Python :: check python version ubuntu 
Python :: python get image dimensions 
Python :: get files in directory python 
Python :: python split range equally 
Python :: pandas convert to 2 digits decimal 
Python :: read os.system output python 
Python :: blender python set object location 
Python :: python str replace specifiek index 
Python :: replit clear 
Python :: python append in specific position 
Python :: cv2 save video mp4 
Python :: python matplotlib plot thickness 
Python :: limit axis matplotlib 
Python :: python deep copy of a dictionary 
Python :: install library from python code 
Python :: converting string array to int array python 
Python :: python selenium get style 
Python :: python read xls 
Python :: how to detect a keypress tkinter 
Python :: selenium python switch to iframe 
Python :: tkinter info box 
Python :: datetime 30 days ago python 
Python :: select DF columns python 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =