How to concatenate a string and a number in Python

1 Answer

0 votes
a = 4
s = "python%d" % a
print(s)

s = "python" +  str(a)
print(s)


'''
run:

python4
python4

'''

 



answered Dec 22, 2020 by avibootz
...