2 # 5 squared# 2 to the power of 7
>>> 3 * ' un ' + ' ium ' unununium '
(' Put several strings within parentheses ' to hasthem joined Together. ' text' Put several strings within parentheses to has them joined Together. '
' Python '
Word[-1# last character' n 'word[-2# second-last character' O ' word[-6]' P '
>>> word[0 Span class= "o" >= ' J ' ... typeerror: ' str ' object does not support item Assignment>>> word[2:] = typeerror: ' str ' object does not support item assignment
[1, 4, 9, +,---------
>>>Letters=[A,' B ',C,' d ',E,' F ',' G ']>>>Letters[' a ', ' b ', ' C ', ' d ', ' e ', ' F ', ' G ']>>># Replace some values>>>Letters[2:5]=[C,D ' E ' ]>>> letters< Span class= "go" >[' a ', ' b ', ' C ', ' D ', ' E ', ' F ', ' G ']>>> # now remove Them>>> letters[2: 5 = []>>> letters[' a ', ' B ', ' F ', ' G ']>>> # clear The list by replacing all the elements with an empty List>>> letters[:] = []>>> letters [] /span>
>>>A=[A,' B ',C]>>> n = [ 123]>>> x = [a Span class= "n" >n]>>> x[[' a ', ' b ', ' C '], [1, 2, 3] >>> x[0 [' a ', ' b ', ' c ']>>> x[ 0][1] ' B '
Python (3)