0% found this document useful (0 votes)
11 views5 pages

Strings: - Python Supports Concatenating Strings Using The Addition Operator

The document discusses different string and list operations in Python including concatenation with addition, repetition with multiplication, and joining lists with addition.

Uploaded by

ss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views5 pages

Strings: - Python Supports Concatenating Strings Using The Addition Operator

The document discusses different string and list operations in Python including concatenation with addition, repetition with multiplication, and joining lists with addition.

Uploaded by

ss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Strings

• Python supports concatenating strings using the addition operator.

h = "hello“
w = "world“
hw = h + " " + w
print(hw)
Strings
• Python also supports multiplying strings to form a string with a
repeating sequence.

h1 = "hello" * 10
print(h1)
Lists
• Lists can be joined with the addition operators.

even_numbers = [2,4,6,8,10]
odd_numbers = [1,3,5,7,9]
all_numbers = odd_numbers + even_numbers
print(all_numbers)
Lists
• Just as in strings, Python supports forming new lists with a repeating
sequence using the multiplication operator.

ls = [1,2,3] * 3
print(ls)

You might also like