Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to print variables in a string python

name = "Steven"

# Using f-strings
print(f"Hi, {name}!")

# Using format()
print("Hi, {}!".format(name))
 
PREVIOUS NEXT
Tagged: #print #variables #string #python
ADD COMMENT
Topic
Name
8+2 =