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 152 views
4 answers 249 views
1 answer 164 views
1 answer 120 views
1 answer 119 views
...