Python (Level-3): Data Types
Important Primitive Data Types.
Python provides a wide variety of primitive data types. Among them, data types such as List, Tuple, Dictionary, and Set are the most essential parts of Python.- String, List, Tuple, Dictionary, and Set
Python provides a wide variety of primitive data types. Among them, data types such as List, Tuple, Dictionary, and Set are the most essential parts of Python.
- String, List, Tuple, Dictionary, and Set
String(in detail)
Let's have a look the string data type in detail
Let's have a look the string data type in detail
5. Let's take a look at String data type in detail.
String data types is really important because chatting is done through words(writing).
Let's study followings.
- string literals
- string formatting
- string operations
Let's take a closer look at the indexing of strings.
Let's take a look at string-related member functions.
- It's about a 'class' you haven't learned yet, but...
- This is a class-related explanation,
but the function has not yet been explained in detail...
so it can be a little difficult to understand.
Let's remember one thing.
- In Python, everything is an object, followed by functions
that can manipulate the object.
List
A list is created by placing elements inside square brackets [] , separated by commas. A list can have any number of items and they may be of different types (integer, float, string, etc.). A list can also have another list as an item.
#### [Self-Practice ] ###
Tuple, Dictionary, Set
A tuple is a collection which is ordered and unchangeable.
Dictionaries are used to store data values in key:value pairs and it is a collection which is ordered, changeable and do not allow duplicates.
Sets are used to store multiple items in a single variable. A set is a collection which is unordered, unchangeable(can add or remove items), and un-indexed.
The process of converting the value of one data type to another data type is called type conversion. Python has two types of type conversion.
- Implicit Type Conversion
- Explicit Type Conversion
- Explicit Type Conversion
Comments
Post a Comment