Python for Beginners: Setup, Variables, Data
Types & Operators:-
• Title: Python for Beginners
• Subtitle: Setup, Variables, Data Types, and Operators
• Presented by: Learn with Abhishek
Foundations of Python Learning
Setup Variables Data Types Operators
Initial steps to start Understanding how Exploring different Learning to perform
coding in Python to store and types of data in operations on data
manipulate data Python
2. Python Installation:-
• Visit: https://www.python.org/downloads
• Download latest version (e.g., Python 3.13.5)
• Run installer:
• Check "Add Python to PATH"
• Click "Install Now"
3. Verify Python Installation
• Open Command Prompt or Terminal
• Type: python --version
• Output: Python 3.13.5
4. Create First Python File
• Create a folder: PythonBasics
• Open in VS Code
• Create file: hello.py
• Code: print("Hello, Python!")
• Right-click → Run Python File in Terminal
Setting Up and Running a Python File
Create Folder Create File
Create a new folder Create a new Python
Run File
named file named 'hello.py'
Execute the Python
'PythonBasics'
file in the terminal
Write Code
Open in VS Code Write the code
`print("Hello,
Open the newly Python!")` in the file
created folder in VS
Code
5. What is a Variable?
• A variable stores data in memory
• Example:
name = "Abhishek"
age = 25
• Naming Rules:
• Start with letter or _
• No spaces or special characters
6. Data Types
• int: x = 10
• float: pi = 3.14
• str: name = "John"
• bool: True/False
• list: [1, 2, 3]
• tuple: (1, 2)
• dict: {"name": "Amit"}
• set: {1, 2, 3}
Fundamental Data Types in Python
bool list
Represents true or Represents ordered
false values 4 5 collections of items
str tuple
Represents Represents
sequences of 3 6 immutable ordered
characters collections
Understanding
Data Types
float dict
2 7
Represents numbers Represents key-
with decimal points value pairs
int 1 8 set
Represents whole Represents
numbers without unordered
decimals collections of unique
items
Numeric Types:-
Data Type Description Example
int Whole numbers x = 10
float Decimal numberspi = 3.14
Text Type
Data Type Description Example
str Text/String name = "John"
Boolean Type:-
Data Type Description Example
bool True or False is_happy = True
Sequence Types:-
Data Type Description Example
list Ordered, changeable marks = [90, 80, 70]
tuple Ordered, unchangeable point = (1, 2)
str Ordered, immutable "Hello"
Set Type:-
Data Type Description Example
set Unordered, unique elements a = {1, 2, 3}
Mapping Type:-
Data Type Description Example
dict Key-value pairs student = {"name": "Amit", "age": 21}
6. Arithmetic Operators:-
+, - , , / , // , % , *
Arithmetic Operators
Exponent
Addition Multiplication Floor Division Performs
exponential
Adds values on Multiplies values on Division that results calculation on
either side. either side. into whole number. operators.
Subtraction Division Modulus
Subtracts right hand Divides left hand Divides left hand
operand from left. operand by right. operand by right and
returns remainder.
Example:-a = 10
b=3
print(a + b) # 13
print(a ** b)
7. Comparison Operators:-
==, !=, >, <, >=, <=
• Example:
• a=5
• print(a > 3) # True
8. Logical Operators:-
and, or, not
Example:
x = True
y = False
print(x and y) # False
9. Check Data Type:-
name = "Abhishek"
print(type(name)) # <class 'str'>
10. Practice Task 1:-
• Create variables for:
• Student name
• Age
• Marks in 3 subjects
• Pass/Fail (boolean)
11.Practice Task 2:-
• Arithmetic exercises:
• Add 2 number
Thank You
Keep Practicing Learn with
Consistent effort
Abhishek
enhances coding A learning resource
skills. for coding
enthusiasts.