Introduction to Python: Core Concepts, Data Types
Python forms the basic foundation of modern programming.
It is a dynamic language, which means it automatically identifies and checks the data type of a value during runtime. Unlike static languages, Python does not require explicit type declarations. Data types such as int, float, bool, and string are assigned based on the value provided, making the language flexible, easy to learn, and efficient for rapid development.
There are five types of Data type in python
- Numeric
- Set
- Sequence
- Boolean
- Dictionary
1. Numeric Data type : It represents data that stored a numeric value. It can store a whole number, an integer, or a floating number.
- Integer : It contains whole numbers, positive and negative (without decimals and fractions). It is represented by using the int class.
- Float : It is a short term for "floating point number," used to represent real numbers having decimals, represented by using the class "float."
- Complex Numbers : It specifically used for imaginary component and real components written by like the letters 'k' and 'i + j '
2. Set Data type : A set is an unordered collection of data elements created using built-in functions. It does not allow duplicate values, and each element in a set is unique.
3. Boolean Data type : Boolean objects that are equal to True are called "truthy" (TRUE), and those equal to False are called "falsy" (FALSE). It is denoted by the class bool.
4. Sequence Data type : It is an ordered collection of items; they could be similar or different data types . Sequences allow you to store multiple data types and values.
- List : It is a collection of ordered and mutable collections of items. A list is very similar to an array.
- Tuple : A tuple is also an ordered collection of objects. We cannot modified tuple once it created.
5. Dictionary Data type : It stores data in key-value pairs, also stores multiple values, and can be any data type, including integer, string, or list. Assigning a new value to an existing key will replace the previous value stored under that key.
Admin
I’m a developer and tech writer passionate about programming and cybersecurity, focused on building secure, practical, and future-ready digital skills.
Categories
- CS Fundamentals 3 Posts
- Python 3 Posts
- DBMS & SQL 2 Posts