List Data Type in Python

 

List  Data Type in Python 


a = [5,10,15,20,25,30,35,40]


# a[2] = 15

print("a[2] = ", a[2])


# a[0:3] = [5, 10, 15]

print("a[0:3] = ", a[0:3])


# a[5:] = [30, 35, 40]

print("a[5:] = ", a[5:])


Output 

a[2] =  15

a[0:3] =  [5, 10, 15]

a[5:] =  [30, 35, 40]

0 comments:

Post a Comment

gurnoorsingh5974@gmail.com

Count Upper Case and Lower Case Word in a string (Python)

  Count Upper Case and Lower Case Word in a string     (Python) def string_test(s):     d={"UPPER_CASE":0, "LOWER_CASE":...