Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Append and Pop functions in Python3

a = ['balotra', 'jodhpur', 'barmer']
a.append('jaipur')
print(a)
a.append([1, 2])
print(a)
a.pop()
print(a)
a.pop(0)
print(a)

print(a[0])

temp = a[0]
a[0] = a[2]
a[2] = temp
print(a)
a[0], a[2] = a[2], a[0]
print(a) 
a.append([3, 2])
print(a)
a[3].append(5)
print(a)
a[3].append('balotra')
print(a)

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.