Python Space
Python Space

@python_spaces

8 Tweets 1 reads Feb 05, 2023
Built-in Data Types in Python (with code snippets)
In Python, every value has a data type. There are various data types and in this thread, we will discuss some of the important ones.
A Thread ๐Ÿงต๐Ÿ‘‡
1๏ธโƒฃ Python Numbers
Numbers are three types in Python
1. Integers
2. floating point numbers
3. complex numbers
2๏ธโƒฃ Strings in Python
A string is a sequence of characters. In Python single, double, and triple quotes are used to define strings.
3๏ธโƒฃ List in Python
Python list is an ordered sequence of items. We can store more than one item of different types in a list. Items in the list are accessed using an index.
4๏ธโƒฃ Tuple in Python
Tuple is an ordered sequence of items same as list. The difference is that tuples are immutable and list is mutable.
5๏ธโƒฃ Python Set
Set is an unordered collection of unique items, which means duplicates are not allowed. Set is defined using {} and items in set are separated by commas. set items are not ordered
6๏ธโƒฃ Dictionary in Python
Dictionary is an unordered collection of key-value pairs. Dictionary is defined using {} and each item is a pair of keys and values.
Finally, we would like to thank @itsafiz for sharing his content with the community. ๐Ÿ’›

Loading suggestions...