0% found this document useful (0 votes)
32 views

Data Types in Python

The standard data types in Python include lists, numbers, strings, dictionaries, and tuples. Tuples are similar to lists but use parentheses and cannot be updated, acting as read-only lists. Lists use brackets, allow updates, and their elements and size can change.

Uploaded by

Inderpal Singh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Data Types in Python

The standard data types in Python include lists, numbers, strings, dictionaries, and tuples. Tuples are similar to lists but use parentheses and cannot be updated, acting as read-only lists. Lists use brackets, allow updates, and their elements and size can change.

Uploaded by

Inderpal Singh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Data types in Python:

The supported standard data types in Python include the following.

1. List.
2. Number.
3. String.
4. Dictionary.
5. Tuples.

Major difference between tuples and lists in Python

Tuples

Tuples are similar to a list, but they


are enclosed within parenthesis,
unlike the list.

The element and size can be


changed.

They cannot be updated.

They act as read-only lists.

Tuples are surrounded by ( )

Example of Tuple Code is, tup = (1,


"a", "string", 1+2)

Lists

The list is used to create a sequence.

The element and size cannot be


changed.

They can be updated.

They act as a changeable list.

Lists are surrounded by [ ]

Example of Lists Code is, L = [1, "a" ,


"string" , 1+2]

You might also like