Python
What is python?
Python is a high-level, interpreted programming language known for its clear syntax and readability. It supports multiple programming paradigms, making it highly versatile for web development, data analysis, artificial intelligence, and automation. With a vast standard library and a massive global community, Python allows developers to write clean, logical code for both small and large-scale projects efficiently.
How many types of Data?
In Python, data types are used to classify and categorize different kinds of data. While Python has dozens of built-in types, they are generally grouped into 7 core categories.
1.Numerical types
· Int: whole numbers, positive or negative, without decimals (e.g., 10,-5).
· Float: floating -point numbers , representing real number with a decimal point (e.g., 10.5, -3.14).
2. sequence types
· Str(string) A sequence of characters enclosed in quotes (e.g., “Hello, Python!”).
· list: A mutable (changeable), ordered sequence of items (e.g., [1, “apple”, 3.4]).
· tuple: An immutable (unchangeable), ordered sequence of items (e.g., (10, 20, 30)).
3.mapping type
· dict (Dictionary): Unordered, mutable collections where every item is a key: value pair (e.g., {“name”: “Alice”, “age”: 25}).
4.set types
· set: An unordered, mutable collection of unique items (e.g., {1, 2, 3}). Duplicates are automatically removed.
· frozenset: An immutable version of a set (cannot be changed after creation).
5.boolean types
· bool: Can only hold one of two values: True or False.
6. Binary Types
· bytes: Immutable sequences of single bytes (e.g., b”Hello”).
· bytearray: A mutable counterpart to bytes.
Get Dhruv Soliya’s stories in your inbox
Join Medium for free to get updates from this writer.
· memoryview: Allows Python code to access the internal data of an object that supports the buffer protocol without copying.
7. None Type
· NoneType: A special type that represents the absence of a value or a null value. Its only possible value is None.
The interview trap- == vs is
If you want to ace your next Python interview, you must understand how memory management works under the hood. A favorite trap question for hiring managers is asking you to differentiate between == and is.
· == checks for value equality. It asks: Do these two objects contain the same data?
· is checks for identity equality. It asks: Do these two variables point to the exact same location in memory?
Pro Tip: Always use == for comparing data, and reserve is strictly for checking singleyons
Like None (e.g., if x is None :).
Master the data types that trip up interns
In production environments, mixing up mutable and immutable objects will break your code.
· Mutable (Can change): Lists, Dictionaries, Sets.
· Immutable (Cannot change): Tuples, Strings, Integers.
A classic mistake is using a mutable object as a default argument in a function:
Because the default list is created only once when the function is defined, subsequent calls will continuously append to the same list. Use my_list= None instead!
Write Pythonic Code — Readability Beats Cleverness
Interns often write complex, multi-line loops to show off, but senior developers prefer readability. Embrace List Comprehensions to write cleaner, more efficient Python.
Why we used python?
Python is widely used because it is easy to learn with a simple, readable syntax that mimics plain English. It is incredibly versatile, powering everything from web development to data science and AI. Additionally, its massive community provides countless pre-built libraries, which drastically speeds up development time.
I hope this blog will be helpfully for you.
Thank you
Write by Dhruv Soliya





