What is Python?
•- Python is a high-level programming
language.
• - Created by Guido van Rossum in 1991.
• - It is easy to read and write, similar to English.
• - Used in web development, data science, AI,
automation, etc.
3.
Why Learn Python?
•- Simple & Easy to Learn
• - Free & Open Source
• - Works on Windows, Mac, and Linux
• - Huge Community Support
• - Used in multiple fields (Web, AI, Data
Science, etc.)
4.
Features of Python
•- Interpreted (Executes line by line)
• - Dynamically Typed (No need to declare
types)
• - Cross-Platform (Runs on multiple OS)
• - Object-Oriented Programming (OOP) support
5.
Writing Your FirstPython Code
• print("Hello, World!")
• - `print()` is used to display output.
6.
Variables and DataTypes
• - Variables store values and Python decides
their type automatically.
• Example:
• name = 'Kai' # String
• age = 20 # Integer
• height = 5.9 # Float
• is_student = True # Boolean
Conditional Statements (If-Else)
•- Used to make decisions in Python.
• Example:
• marks = 85
• if marks >= 50:
• print('You Passed!')
• else:
• print('You Failed!')
9.
Loops in Python
•- `for` loop: Used for fixed repetitions
• - `while` loop: Repeats until condition is False
• Example:
• for i in range(5):
• print(i)
10.
Lists in Python
•- Lists are used to store multiple values.
• Example:
• fruits = ['Apple', 'Banana', 'Cherry']
• print(fruits[0]) # Apple
• print(len(fruits)) # 3