GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — Python Data Types - GeeksforGeeks Python Data TypesLast Updated : 19 Sep, 2026 Data types in Python define the type of value stored in a variable and determine the operations that can be performed on that data. Since Python treats everything as an object, each value is associated with a specific data type.
![]() Below code assigns different types of values to variable x. With each new assignment, the previous value is replaced and x changes to the new data type.
Numeric Data TypesIn, Python Numeric data types are used to store numeric values. It can be an integer, floating number or even a complex number. It supports three main numeric types:
Output <class 'int'> <class 'float'> <class 'complex'> Sequence Data TypesA sequence is an ordered collection of items, which can be of similar or different data types. Elements in a sequence can be accessed using indexing. 1. StringStrings are used to store text data. A string is represented using the str class and can be created using single, double or triple quotes.
Output Welcome to the Geeks World <class 'str'> e d 2. ListLists are ordered and mutable collections used to store multiple items in a single variable. Elements in a list can be of different data types and are accessed using indexing.
Output [1, 2, 3] 4 Geeks 3. TupleTuples are ordered and immutable collections used to store multiple items in a single variable. Once created, tuple elements cannot be modified and are accessed using indexing.
Output <class 'tuple'> 1 Geeks Boolean Data TypeBoolean data type represents one of two values: True or False. It is mainly used in conditions and comparisons and is represented by the bool class.
Output <class 'bool'> <class 'bool'> Truthy and Falsy Valuestruthy and falsy values are values that evaluate to True or False in a Boolean context. Truthy values behave like True, while falsy values behave like False when used in conditions.
Output 1 is truthy 0 is falsy Set Data TypeSets are unordered and mutable collections used to store unique elements. Since sets are unordered, elements cannot be accessed using indexing. Elements are usually accessed by iterating through the set using a loop.
Output {'b', 'a', 'c'}
Geeks
For
Dictionary Data TypeDictionaries are used to store data in key:value pairs. Each key in a dictionary must be unique and values are accessed using their keys with square brackets [] or get() method.
Output Geeks For Comment Explore |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |