Introduction to Python A Beginner's Guide Presented by: [Your Name] College Name: [Your College]
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.
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.)
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
Writing Your First Python Code print("Hello, World!") - `print()` is used to display output.
Variables and Data Types - Variables store values and Python decides their type automatically. Example: name = 'Kai' # String age = 20 # Integer height = 5.9 # Float is_student = True # Boolean
Operators in Python - Arithmetic Operators: +, -, *, /, %, ** - Comparison Operators: >, <, ==, != - Logical Operators: and, or, not - Assignment Operators: =, +=, -=, *=, /= - Identity & Membership Operators: is, in
Conditional Statements (If-Else) - Used to make decisions in Python. Example: marks = 85 if marks >= 50: print('You Passed!') else: print('You Failed!')
Loops in Python - `for` loop: Used for fixed repetitions - `while` loop: Repeats until condition is False Example: for i in range(5): print(i)
Lists in Python - Lists are used to store multiple values. Example: fruits = ['Apple', 'Banana', 'Cherry'] print(fruits[0]) # Apple print(len(fruits)) # 3
Functions in Python - Functions allow code reuse. Example: def greet(name): return 'Hello, ' + name print(greet('Kai'))
Python Applications - Web Development (Django, Flask) - Data Science (Pandas, NumPy) - Machine Learning (TensorFlow, PyTorch) - Automation & Scripting - Game Development
Conclusion - Python is easy to learn and powerful. - Used in various fields like Web, AI, and Data Science. - Keep practicing to master Python!