Array in python

Total Post:113

Points:791
 226  View(s)
Ratings:
Rate this:

Explain all arrays in Python ?

  1. Post:140

    Points:984
    Re: Array in python

    Python Collections (Arrays) :

    There are four data types in the Python Array: 

    1. List : ordered,changeable, duplicate members. 

    Ex.

    thislist = ["apple", "banana", "cherry"]
    
    print(thislist)

    2. Tuple : ordered,unchangeable,duplicate members. 

    Ex:

    thistuple = ("apple", "banana", "cherry")
    
    print(thistuple)

    3. Set : unordered, unindexed,No duplicate members. 

    ex.

    thisset = {"apple", "banana", "cherry"}
    
    print(thisset)

    4. Dictionary :unordered, changeable, indexed,No duplicate members. 

    ex.

    thisdict = { 
      "apple": "green",
      "banana": "yellow",
      "cherry": "red"
    }
    print(thisdict)

Answer