There are three built-in data structures in Python-lists, tuple tuples, and dictionary Dict
Items in the list are included in square brackets , and items are separated by commas
Tuples and lists are very similar, except that tuples and strings are immutable , meaning that you cannot modify tuples. Tuples are defined by a comma-separated list of items in parentheses .
The most common use of tuples is in the print statement
Age = 22
name = ' Swaroop '
Print '%s is%d years old '% (name, age)
Print ' Why are%s playing with that python? '% name
A dictionary is similar to a key-value pair, and a dictionary is an instance/object of the Dict class, remembering that the key/value pairs in the dictionary are not sequential.
Key-value pairs are tagged in the dictionary in such a way that: D = {key1:value1, key2:value2}. Note that their key/value pairs are separated by colons, and each pair is separated by commas, all of which are included in curly braces.
Lists, tuples, and strings are sequences, and the two main features of a sequence are index operators and slice operators.
The index operator allows us to grab a specific item from the sequence, which is the subscript operation. The index can be negative, in which case the position is calculated from the end of the sequence. Therefore, Shoplist[-1] represents the last element of the sequence
The slice operator allows us to get a slice of the sequence, which is part of the sequence.
The assignment statement for the list does not create a copy (it is simply a reference). You have to use the slice operator to create a copy of the sequence.