Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

read variable in a string python

variable_1 = "Python"
variable_2 = "Django"
age = 20

# insert variables into string using f-string
insert_var = f"Hello {variable_1} and {variable_2} I'm Pytutorial I'm {age} years old"

#print
print(insert_var)
Comment

PREVIOUS NEXT
Code Example
Python :: how to define a functio in python 
Python :: conda create new env 
Python :: How to make a function repeat itself a specifc amount of times python 
Python :: Generate bootstrap sample 
Python :: how to draw dendrogram in python 
Python :: duplicate a list with for loop in python 
Python :: pahtlib join path 
Python :: insert an element in list python 
Python :: pandas convert string to float 
Python :: get table wikipedia 
Python :: calculating auc 
Python :: false in py 
Python :: calendar library in python 
Python :: python how to make boxplots with swarmplot 
Python :: what does enumerate do in python 
Python :: pandas dataframe apply 
Python :: load list from file python 
Python :: django MESSAGE_TAGS 
Python :: streamlit add chart 
Python :: python class without init 
Python :: convert rgb image to binary in pillow 
Python :: code example of sum of the first n odd numbers using for loop 
Python :: #remove leading and trailing spaces 
Python :: remove punctuation from a string 
Python :: python numpy array subtract 
Python :: sample hierarchical clustering 
Python :: app.py 
Python :: qr detector 
Python :: python string contains substring ignore case 
Python :: how to overlap two barplots in seaborn 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =