Python Interview Questions
Python Interview Questions
Tuple:
1. Tuple is created by using ( ) symbol.
2. Tuple elements are immutable.
Example: b = (100, 200, 300)
What is set?
Set is created by using { } symbol.
Set stores elements in random order and doesn’t allow duplicate elements.
Example: c = {‘palle’, ‘python’, ‘bangalore’}
What is a dictionary?
Dictionary is used to store key-value pairs. Keys should be unique, and values can be
duplicates.
Example: d = {'email': '[email protected]', 'pw': 'abcd123', 'course': 'python',
'duration': 90}
List:
1. In a list, we can store both homogeneous and heterogeneous elements.