How to append one string to another in Python

2 Answers

0 votes
s1 = "python"
s2 = "c++"

s1 += s2

print(s1)
print(s2)

 
  
  
  
'''
run:
  
pythonc++
c++
  
'''

 



answered Apr 13, 2021 by avibootz
0 votes
s1 = "python"
s2 = "c++"

s1 = "".join((s1, s2))

print(s1)
print(s2)

 
  
  
  
'''
run:
  
pythonc++
c++
  
'''

 



answered Apr 13, 2021 by avibootz

Related questions

1 answer 160 views
4 answers 257 views
1 answer 169 views
1 answer 128 views
1 answer 125 views
...