- Home
- Course Detail
regularpython@gmail.com
You are now watching:
AWS Data Engineer 30 Days Plan (Python) / of Python Data Types
๐ฅ Download Python ๐ Open Course Files ๐ Student Dashboard ๐ป GitHub Repository ๐ง Download Git ๐ Tools & Software
๐ Python Data Types and Operators – Very Simple Explanation for Beginners
โ What is a Data Type?
A data type means the kind of value you're storing in your program. Just like we use different boxes for sugar, salt, and rice ๐ — Python uses different types to store different data.
| ๐ค Real-Life Example | ๐ง Python Data Type |
|---|---|
| Age = 25 | int |
| Price = 19.99 | float |
| Name = "Sairam" | str |
| Is student = Yes/No | bool |
| List of fruits | list |
| User details | dict |
๐ง Python Data Types – With Simple Examples
| ๐ข Type | ๐ฌ Meaning | ๐งช Example | โ Where You Use |
|---|---|---|---|
| int | Whole number | age = 30 | Age, count, salary |
| float | Decimal number | price = 99.99 | Weight, marks, price |
| str | Text | name = "Sairam" | Names, messages |
| bool | True/False | is_active = True | Login, status check |
| list | Group of items | fruits = ["apple", "banana"] | Cart, items |
| tuple | Fixed group | location = (17.3, 78.4) | Coordinates, dates |
| dict | Key + Value | {"name": "Sairam", "age": 25} | User data, API |
| set | Unique items | set([1, 2, 3]) | Tags, IDs |
| None | Empty value | value = None | Not assigned yet |
“Data Types are containers. Operators are tools to use them.”
โ๏ธ Python Operators – With Examples
Operators are symbols that perform actions on variables or values. Just like + adds numbers in school, it adds numbers in Python too!
| ๐ง Type | โ๏ธ Symbols | ๐ฌ Use | ๐งช Example |
|---|---|---|---|
| Arithmetic | + - * / % ** // | Math operations | 5 + 2 = 7 |
| Assignment | = += -= | Store or update value | x = 10 x += 2 |
| Comparison | == != > < | Check values | 5 > 2 = True |
| Logical | and or not | Combine conditions | True and False = False |
| Membership | in | Check presence | "milk" in cart |
| Identity | is | Same object? | a is b |
| Bitwise | & | ^ | Binary logic | 5 & 3 = 1 |
๐ง๐ซ Real-Life Example
cart = ["biryani", "coke"]
price = 150.0
quantity = 2
total = price * quantity
if "coke" in cart:
print("Free Pepsi!")
price = 150.0
quantity = 2
total = price * quantity
if "coke" in cart:
print("Free Pepsi!")
๐งฑ How Data Types and Operators Work Together
product = "Laptop"
price = 49999.0
discount = 5000
final_price = price - discount
print("Final Price:", final_price)
price = 49999.0
discount = 5000
final_price = price - discount
print("Final Price:", final_price)
๐ Summary for Zero-Knowledge Learners
| Topic | Meaning | Example |
|---|---|---|
| Data Types | Kind of value | int, str, list |
| Operators | Actions on values | +, in, == |
| Use | Write logic | if price > 500 |
“Data Types hold the data. Operators work on that data.”
๐ฏ Like storing ingredients in jars and using tools to cook ๐ณ
๐ฏ Like storing ingredients in jars and using tools to cook ๐ณ