Tuesday, 26 November 2019

Write a algorithm and python program for string concatenation

# Program-1
>>> 'a' + 'b' + 'c'

Output
'abc'

# program-2
>>> 'do' * 2

Output
'dodo'

# Program-3
>>> orig_string = 'Hello'
>>> orig_string + ', world'
Output
'Hello, world'

>>> orig_string = 'Hello'
>>> orig_string
Output
'Hello'

>>> full_sentence = orig_string + ', world'
>>> full_sentence
'Hello, world'




No comments:

Post a Comment