Python Variables & Rules
๐ | เคเคธाเคจ เคนिंเคฆी เคเคฐ English เคฎें |
Welcome to another step in your Python journey!
Today, we’ll learn about variables — the containers that hold data — and the basic rules you must follow when writing Python code.
๐ค What Are Variables? | Variables เค्เคฏा เคนोเคคे เคนैं?
English:
Variables are names that store values. Think of them like labeled boxes where you can keep your data.
เคนिंเคฆी:
Variables เคตो เคจाเคฎ เคนोเคคे เคนैं เคिเคจเคฎें เคเคช เคोเค เคตैเคฒ्เคฏू (เคกेเคा) เคธ्เคोเคฐ เคเคฐ เคธเคเคคे เคนैं। เคैเคธे เคเค เคกिเคฌ्เคฌा เคिเคธเคฎें เคเคช เคुเค เคฐเค เคธเคเคคे เคนैं।
๐งช Example of a Variable | Variable เคा เคเคฆाเคนเคฐเคฃ
name = "Rahul"
age = 25
is_student = True
English:
Here, name, age, and is_student are variables storing a string, number, and boolean value.
เคนिंเคฆी:
เคฏเคนाँ name, age, เคเคฐ is_student เคคीเคจ variables เคนैं เคो string, number เคเคฐ boolean เคตैเคฒ्เคฏू เคो เคธ्เคोเคฐ เคเคฐ เคฐเคนे เคนैं।
๐ Basic Rules for Variables in Python | Python เคฎें Variables เคे เคจिเคฏเคฎ
| Rule | English Explanation | เคนिंเคฆी เคฎें เคธเคฎเค |
|---|---|---|
✅ Must start with a letter or underscore _ | You can’t start with a number | เคจंเคฌเคฐ เคธे เคถुเคฐू เคจเคนीं เคนो เคธเคเคคा |
| ✅ Can contain letters, numbers, and underscores | Spaces are not allowed | เคธ्เคชेเคธ เคจเคนीं เคนोเคจा เคाเคนिเค |
| ❌ Cannot use Python keywords | Words like if, for, class are reserved | Python เคे keywords เคเคธ्เคคेเคฎाเคฒ เคจเคนीं เคเคฐ เคธเคเคคे |
| ✅ Case-sensitive | Name and name are different | เคोเคे-เคฌเคก़े เค เค्เคทเคฐ เค เคฒเค เคฎाเคจे เคाเคคे เคนैं |
๐ง Good Variable Naming Tips | เค เค्เคे Variable เคจाเคฎ เคฐเคเคจे เคे เคिเคช्เคธ
- Use meaningful names:
score,user_name,total_amount - Avoid single letters like
x,yunless for math - Use snake_case for multi-word names:
user_age,product_price
๐ฏ Final Thoughts | เคเค़िเคฐी เคฌाเคค
English:
Variables are the foundation of any program. Learn to name them well and follow the rules — it’ll make your code clean and easy to understand.
เคนिंเคฆी:
Variables เคिเคธी เคญी เคช्เคฐोเค्เคฐाเคฎ เคी เคจींเคต เคนोเคคे เคนैं। เคเคจ्เคนें เคธเคนी เคจाเคฎ เคฆेเคจा เคเคฐ เคจिเคฏเคฎों เคा เคชाเคฒเคจ เคเคฐเคจा เค़เคฐूเคฐी เคนै เคคाเคि เคोเคก เคธाเคซ़ เคเคฐ เคธเคฎเคเคจे เคฎें เคเคธाเคจ เคนो।
Comments
Post a Comment