স্ট্রিং অপারেশন
>>> "Spam" + 'eggs'
'Spameggs'>>> print("First string" + ", " + "second string")
First string, second string>>> "2" + "2"
'22'
>>> 1 + '2' + 3 + '4'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'>>> print("spam" * 3)
spamspamspam
>>> 4 * '2'
'2222'
>>> '17' * '87'
TypeError: can't multiply sequence by non-int of type 'str'
>>> 'pythonisfun' * 7.0
TypeError: can't multiply sequence by non-int of type 'float'Last updated