Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

concatenate python

# theres a lot of ways to concatenate in python
# here are all examples that i know:

world = 'World!'
number = '69'

a = 'Hello ' + ' ' + world + ' ' + number
b = 'Hello {} {}'.format(world, number)
c = f'Hello {world} {number}'  # most easy / beginner friendly
d = 'Hello %s %s', % (world, number)
e = 'Hello', world, number

# all of these will print "Hello World! 69"
print(a)
print(b)
print(c)
print(d)
print(e)
 
PREVIOUS NEXT
Tagged: #concatenate #python
ADD COMMENT
Topic
Name
2+1 =