Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python Print Variable Using the string formatting with positional arguments {}

# string formatting without positional specifiers
first_name = "Bing"
last_name = "Chandler"
age =25
print("The full name of the Employee is {0} {1} and the age is {2} ".format(last_name, first_name,age))
print("The full name of the Employee is {1} {0} and the age is {2} ".format(last_name, first_name,age))
Source by itsmycode.com #
 
PREVIOUS NEXT
Tagged: #Python #Print #Variable #Using #string #formatting #positional #arguments
ADD COMMENT
Topic
Name
3+1 =