PYTHON BY MOHIT PANSURIYA programing.pptx

raviofficialmrm06 8 views 12 slides Mar 07, 2025
Slide 1
Slide 1 of 12
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12

About This Presentation

Python program basic notz


Slide Content

Introduction to Python BY MOHIT PANSURIYA

What is Python? - Python is a high-level, interpreted programming language. - It is known for its simplicity and readability. - Used in web development, data science, automation, and more.

Features of Python - Easy to learn and use - Open-source and free - Interpreted language - Cross-platform compatibility - Large standard library - Object-oriented and functional programming support

Python Syntax and Variables - Python uses indentation instead of braces. - Variables do not require explicit declaration. - Example: ```python name = 'John' age = 25 print(name, age) ```

Data Types and Operators - Common Data Types: int, float, str, list, tuple, dict - Operators: Arithmetic, Comparison, Logical, Assignment, Bitwise - Example: ```python a = 10 b = 5 print(a + b, a > b) ```

Control Flow (if-else, loops) - Conditional statements (if, elif, else) - Loops (for, while) - Example: ```python x = 10 if x > 5: print('X is greater than 5') for i in range(3): print(i) ```

Functions and Modules - Functions help in code reusability. - Modules allow importing additional functionalities. - Example: ```python def greet(name): return f'Hello, {name}!' print(greet('Alice')) ```

Basic File Handling - Reading and writing files - Example: ```python with open('file.txt', 'w') as f: f.write('Hello, Python!') ```

Simple Python Program Example - Example program to add two numbers: ```python num1 = int(input('Enter first number: ')) num2 = int(input('Enter second number: ')) sum = num1 + num2 print('Sum:', sum) ```

Conclusion - Python is a beginner-friendly language. - It is widely used in various fields. - Start practicing by writing simple programs! - Explore libraries and frameworks to enhance your skills.

Creating a List # List of integers a = [Audi, BMW, Farari ] # List of strings b = ['apple', 'banana', 'cherry'] # Mixed data types c = [hello] print(a) print(b) print(c)

OUTPUT [Audi, BMW, Farari ] ['apple', 'banana', 'cherry '] [hello]