Monday, 25 May 2015

Concatenation in python

We are using  + operator for Concatenation in python.

>>> str1 = "Hello "
>>> str2 = "To world"
>>> a = str1 + str2
>>> print(a)
Hello To world
>>>

Concatenate two numbers in string format:

>>> str1 = "123 "
>>> str2 = "456"
>>> a = str1 + str2
>>> print a
123 456
>>>

Simple + operator in python

>>> str1 = "123 "
>>> str2 = "456"
>>> a = str1 + str2
>>> print a
123 456
>>> 

No comments:

Post a Comment