Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to insert a variable into a string without breaking up the string in python

name = "Dan"
age = 21
#you need to have that "f" before the string
name_and_age = f"My name is {name}, and I am {age} years old."
print(name_and_age)
Source by matthew-brett.github.io #
 
PREVIOUS NEXT
Tagged: #insert #variable #string #breaking #string #python
ADD COMMENT
Topic
Name
9+4 =