0% found this document useful (0 votes)
20 views

Python Hinglish Content

python

Uploaded by

Pk Bhai
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Python Hinglish Content

python

Uploaded by

Pk Bhai
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

### Python ka Introduction

Python ek open-source, high-level, dynamically typed, interpreted aur object-


oriented programming language hai, jo apni simplicity aur readability ke liye
famous hai. Isse 1991 mein Guido van Rossum ne banaya tha aur baad mein Python
Software Foundation ne isse develop kiya.

Iska syntax programmers ko kam lines of code mein apne concepts express karne ka
option deta hai. Python ek aisi language hai jo fast kaam karne aur systems ko
efficiently integrate karne ki facility deti hai.

---

### Python ke Versions

#### Python 1.x (Released: 1991)


- Basic features jaise exception handling, functions aur core data types (lists,
dictionaries, etc.) ko introduce kiya gaya.

#### Python 2.x (Released: 2000)


- List comprehensions, garbage collection aur yield statement add kiye gaye.
- Unicode support aaya, lekin 'u' prefix ke sath.
- Integers ka division result integer deta tha, jaise 5 / 2 = 2.

#### Python 3.x (Released: 2008)


- **Print Function**: print ab ek function ban gaya hai. Example: print("Hello,
World!").
- **Integer Division**: 5 / 2 ka result float hoga, 2.5.
- Strings by default Unicode hain.
- Iterators aur library improvements ke sath cleaner syntax aaya.

---

### Python ki Features

1. **Easy to Read and Write**: Python ka syntax beginners aur experienced


developers ke liye clear aur concise hai.
2. **Interpreted Language**: Line by line execute hota hai, jo debugging ko easy
banata hai.
3. **Dynamically Typed**: Variable types explicitly declare karna zaroori nahi hai.
4. **Extensive Standard Library**: Multiple programming tasks ke liye tools
available hain.
5. **Cross-Platform**: Python programs bina modification ke Windows, macOS aur
Linux par run ho sakte hain.
6. **Community Support**: Iski badi aur active community se Django, TensorFlow
jaise tools available hain.

---

### Python ka Installation Guide

#### Windows Installation


1. **Python website visit karo**:
[python.org/downloads](https://www.python.org/downloads).
2. Download installer (e.g., .exe file).
3. **Install karo aur "Add Path" checkbox ko select karo.**
4. Installation ke baad cmd mein python --version command se verify karo.

#### macOS Installation


- Terminal open karo aur type karo: brew install python3.
- Install hone ke baad verify karne ke liye type karo: python3 --version.

#### Linux Installation


- Linux OS par Python pehle se installed hota hai. python --version command se
check karo.

---

### Python Syntax and Concepts

#### Indentation
Python mein code structure define karne ke liye whitespace use hoti hai. Jaise:
```python
def greet(name):
if name:
print(f"Hello, {name}!")
else:
print("Hello, World!")
```
- Indentation ke bina Python syntax error dega.

#### Variables
- Variables ko declare karne ke liye koi type specify karna zaroori nahi. Example:
```python
x = 10
name = "Python"
```

#### Data Types


1. **Numeric**: Integers, floats aur complex numbers.
2. **Sequence**: Strings, lists, tuples.
3. **Boolean**: True aur False.
4. **Set**: Unique, unordered elements.
5. **Dictionary**: Key-value pairs.

---

### Operators in Python

1. **Arithmetic Operators**: Addition (+), Subtraction (-), Multiplication (*),


Division (/), Modulus (%).
2. **Comparison Operators**: ==, !=, <, >, <=, >=.
3. **Logical Operators**: and, or, not. Example:
```python
a = True
b = False
print(a and b) # False
```
4. **Bitwise Operators**: &, |, ^, ~, <<, >>.

---

You might also like