Curriculum
Variables & Data Types in Python is one of the fundamental concepts in a Data Science & Data Analysis Course in Jaipur. Variables are used to store data in memory, while data types define the kind of value stored inside variables.
Understanding variables and data types is essential because every Python program depends on storing, processing, and manipulating data. Data Science, Machine Learning, Artificial Intelligence, Web Development, and Automation systems all use variables extensively.
Python makes variable handling simple and beginner-friendly because it automatically detects data types during execution.
A variable is a name used to store data in memory.
Variables allow programmers to:
name = "Aman"
age = 22
print(name)
print(age)
Aman
22
In this example:
name stores a string valueage stores an integer valuePython has specific rules for variable names.
student_name = "Rahul"
marks1 = 95
course_name = "Python"
1name = "Rahul"
student name = "Aman"
class = "Python"
Data types define the type of value stored inside a variable.
Python supports multiple data types for handling different kinds of data.
| Data Type | Description | Example |
|---|---|---|
| int | Integer numbers | 10 |
| float | Decimal numbers | 10.5 |
| str | Text/String | “Python” |
| bool | True/False values | True |
| list | Collection of values | [1,2,3] |
| tuple | Immutable collection | (1,2,3) |
| set | Unordered unique values | {1,2,3} |
| dict | Key-value pairs | {“name”:”Aman”} |
Integers store whole numbers.
age = 25
marks = 90
print(age)
print(marks)
25
90
Float stores decimal values.
price = 199.99
percentage = 85.5
print(price)
print(percentage)
199.99
85.5
Strings store text data.
course = "Data Science"
city = "Jaipur"
print(course)
print(city)
Data Science
Jaipur
Strings can be written using:
Boolean stores only:
is_student = True
is_logged_in = False
print(is_student)
print(is_logged_in)
True
False
Boolean values are commonly used in conditions and decision-making.
Lists store multiple values in a single variable.
subjects = ["Python", "SQL", "Power BI"]
print(subjects)
['Python', 'SQL', 'Power BI']
Tuples are similar to lists but immutable.
numbers = (1, 2, 3, 4)
print(numbers)
(1, 2, 3, 4)
Tuples cannot be modified after creation.
Sets store unique unordered values.
values = {1, 2, 3, 3, 4}
print(values)
{1, 2, 3, 4}
Duplicate values are automatically removed.
Dictionaries store data using key-value pairs.
student = {
"name": "Aman",
"age": 22,
"course": "Python"
}
print(student)
{'name': 'Aman', 'age': 22, 'course': 'Python'}
Dictionaries are widely used in Data Science and APIs.
Python provides the type() function.
name = "Rahul"
age = 22
print(type(name))
print(type(age))
<class 'str'>
<class 'int'>
Python allows converting one data type into another.
num = 10
print(float(num))
price = 99.99
print(int(price))
age = 25
print(str(age))
Type conversion is useful during calculations and user input processing.
Python automatically detects variable types.
x = 10
x = "Python"
print(x)
Python allows changing variable data types dynamically.
Students should:
student_marks = 95
x = 95
Readable code improves maintainability.
Variables and data types are used in:
Almost every software application depends on data storage and manipulation.
Companies in Jaipur hiring Python and Data Science professionals expect:
Variables and data types form the foundation for advanced programming concepts.
Create variables to store:
Display all values using print().
Create variables using:
Use type() to check their data types.
Create:
In this lesson, students learned:
This lesson forms the foundation for advanced Python programming and Data Science concepts.
A variable is used to store data in memory.
Data types define the type of value stored inside a variable.
The str data type stores text values.
Lists are mutable, while tuples are immutable.
Python automatically detects variable data types during execution.
The type() function checks variable data types.
Variables help store and manipulate data in programs.
WhatsApp us