Important Notice:

Variables

Variables

2 views 1 min read

Variables (वेरिएबल्स):-

Variable (वेरिएबल) Python का एक महत्वपूर्ण भाग है, जिसका उपयोग Data (डेटा) या Value (मान) को Memory (मेमोरी) में Store (संग्रहीत) करने के लिए किया जाता है।

Variable एक नाम (Name) होता है जो Memory में Store की गई किसी Value को दर्शाता है। Program में Value का उपयोग, परिवर्तन (Modify) तथा Processing करने के लिए Variable का उपयोग किया जाता है।

Python में Variable बनाने के लिए Data Type (जैसे int, float, str, bool आदि) पहले से लिखने की आवश्यकता नहीं होती। जब किसी Variable को Value दी जाती है, तो Python स्वतः (Automatically) उसके Data Type का निर्धारण कर लेता है।

इसी कारण Python को Dynamic Typed Language (डायनेमिक टाइप्ड भाषा) कहा जाता है। इसमें Variable का Data Type Program के Execute होने के समय (Runtime) स्वतः निर्धारित होता है। यदि बाद में उसी Variable को किसी अन्य प्रकार (Different Data Type) की Value दी जाए, तो Python उसका Data Type भी स्वतः बदल देता है।

एक Variable में एक समय पर एक ही Value Store रहती है, लेकिन Program के दौरान उसकी Value को बदला जा सकता है।

English

A Variable is an important part of Python that is used to store data or values in memory.

A Variable is a name that refers to a value stored in memory. It allows the program to store, access, modify, and process data.

Python does not require the programmer to declare the data type before creating a variable. When a value is assigned, Python automatically determines its data type.

Therefore, Python is called a Dynamic Typed Language. The data type of a variable is determined automatically at runtime. If a different type of value is assigned to the same variable later, Python automatically changes its data type.

A variable stores one value at a time, but its value can be changed during program execution.

Example -

name = "Rahul"
age = 20
print(name)
print(age)

Output-

Rahul

20

Related Notes