005. Python me variable kya hain?

Prathmesh Mayekar
0

 Python mein variables ka use hota hai values ko store karne ke liye. Har variable ko ek specific naam diya jata hai jisse hum usse baad mein use kar sakte hain. Variable ko create karne ke liye hum ek naam likhte hain, phir uske baad equals (=) sign use karke usmein value assign karte hain.


Jaise, agar hum 'num' variable mein 5 store karna chahte hain, toh hum aisa karenge:


```python

num = 5

```


Variable ko use karne ke liye, hum bas uske naam ka use karte hain. Jaise:


```python

print(num)

```


Output: 5


Python mein variables ko kisi bhi valid naam se create kar sakte hain, lekin kuch rules follow karne padte hain:

- Naam variable ko start karna chahiye alphabets se (A se lekar Z tak) ya phir underscore (_) se.

- Baad mein alphabets (A-Z, a-z), digits (0-9) ya underscores (_) ka use karna allowed hai.

- Variable naam case-sensitive hota hai, matlab 'num' aur 'Num' alag-alag variables honge.


Ummid hai yeh tutorial aapke liye helpful hoga! Agar aur kuch jaanna ho toh poochh sakte hain.

Post a Comment

0Comments

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Accept !