Python | String are Array

python string array,python string array index
python string array


      String Are Array

An Array is a data structure, which can store a collection of data of the same data type .

Array 's counting starting from 0,1,2,3.....


Example

Welcome 

so,    0 position store a W

        1 position store a e

        2 position store a c 


Example

    A = "Welcome"

    # Now , only just get the first character From variable ' A '. You can Access Elements using        Square brackets [ ]

    

    print(a[1])      # Return e 

    print(a[5])      # Return m


if you want only last positioned value from Array 

    

    print(a[-1])     # Return e   

    print(a[-2])     # Return m 




Post a Comment (0)
Previous Post Next Post