0% found this document useful (0 votes)
3 views6 pages

Python Variables and Data Types Explained

The document provides an overview of variables and data types in Python, explaining that a variable is a container for storing values and that data types indicate the kind of value stored. It covers five basic data types: int, float, str, bool, and None, along with practical examples of each type. Additionally, it highlights Python's dynamic typing feature, which allows variables to change types without explicit declaration.

Uploaded by

mathisaravanan23
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views6 pages

Python Variables and Data Types Explained

The document provides an overview of variables and data types in Python, explaining that a variable is a container for storing values and that data types indicate the kind of value stored. It covers five basic data types: int, float, str, bool, and None, along with practical examples of each type. Additionally, it highlights Python's dynamic typing feature, which allows variables to change types without explicit declaration.

Uploaded by

mathisaravanan23
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Gowtham SB

[Link]/in/sbgowtham/ Instagram - @dataengineeringtamil

Variables & Data Types in Python (int, float, str, bool, None)

🟢 Step 1: Start with the Theory (Simple Explanation)

✅ What is a Variable?

A variable is like a container that stores a value in memory. You can give it
a name and reuse it later.

Example:

x = 10

This means:

Store the number 10 inside a box named x.

✅ What is a Data Type?

A data type tells Python what kind of value is stored in the variable.

For example:

● If it's a number → Python treats it as a number

● If it's text → Python treats it as a string

🔸 Python has dynamic typing:

You don’t need to declare data types. Python figures it out automatically!
Gowtham SB
[Link]/in/sbgowtham/ Instagram - @dataengineeringtamil

Step 2: Show Practical Examples in Code

# Integer

age = 25

print(age, type(age)) # Output: 25 <class 'int'>

# Float

price = 99.99

print(price, type(price)) # Output: 99.99 <class 'float'>

# String

name = "Gowtham"

print(name, type(name)) # Output: Gowtham <class 'str'>

# Boolean

is_active = True

print(is_active, type(is_active)) # Output: True <class 'bool'>

# None Type

address = None

print(address, type(address)) # Output: None <class 'NoneType'>


Gowtham SB
[Link]/in/sbgowtham/ Instagram - @dataengineeringtamil

Each Type Briefly (with Relatable Examples)

Type Use Case Explanation


Example

int age = 30 Whole numbers

float pi = 3.14 Numbers with decimals

str name = "Python" Text/characters

bool is_logged_in = True or False (logic conditions)


True

Non user_data = None Means “nothing” or “no value


e yet”

✨ BONUS – Dynamic Typing in Action:

x = 10 # int

x = "Hello" # now it's str


Gowtham SB
[Link]/in/sbgowtham/ Instagram - @dataengineeringtamil

x = 3.14 # now it's float

print(x)

🎯 Ending Summary (Quick Recap)

Variables store data.


Data types tell Python what kind of data it is.
Python automatically figures out the type (dynamic typing).
5 basic types every beginner must know:

● int

● float

● str

● bool

● None
Gowtham SB
[Link]/in/sbgowtham/ Instagram - @dataengineeringtamil

About the Author

Gowtham SB is a Data Engineering expert, educator, and content creator with a


passion for big data technologies, as well as cloud and Gen AI . With years of
experience in the field, he has worked extensively with cloud platforms, distributed
systems, and data pipelines, helping professionals and aspiring engineers master the
art of data engineering.

Beyond his technical expertise, Gowtham is a renowned mentor and speaker, sharing
his insights through engaging content on YouTube and LinkedIn. He has built one of
the largest Tamil Data Engineering communities, guiding thousands of learners to
excel in their careers.

Through his deep industry knowledge and hands-on approach, Gowtham continues to
bridge the gap between learning and real-world implementation, empowering
individuals to build scalable, high-performance data solutions.

𝐒𝐨𝐜𝐢𝐚𝐥𝐬

🎥𝐘𝐨𝐮𝐓𝐮𝐛𝐞 - https: //[Link]/@dataengineeringvideos

📸𝐈𝐧𝐬𝐭𝐚𝐠𝐫𝐚𝐦 - https: //[Link]/dataengineeringtamil

📸𝐈𝐧𝐬𝐭𝐚𝐠𝐫𝐚𝐦 - https: //[Link]/[Link]

🤝𝐂𝐨𝐧𝐧𝐞𝐜𝐭 𝐟𝐨𝐫 𝟏: 𝟏 - https: //[Link]/dataengineering/

💼𝐋𝐢𝐧𝐤𝐞𝐝𝐈𝐧 - https: //[Link]/in/sbgowtham/

🌐𝐖𝐞𝐛𝐬𝐢𝐭𝐞 - https: //[Link]

💻𝐆𝐢𝐭𝐇𝐮𝐛 - http: //[Link]/Gowthamdataengineer

💬𝐖𝐡𝐚𝐭𝐬 𝐀𝐩𝐩 - https: //[Link]/g5JrHw8q

📧𝐄𝐦𝐚𝐢𝐥 - [Link]@[Link]

📱𝐀𝐥𝐥 𝐌𝐲 𝐒𝐨𝐜𝐢𝐚𝐥𝐬 - https: //[Link]/gf8k3aCH


Gowtham SB
[Link]/in/sbgowtham/ Instagram - @dataengineeringtamil

You might also like