0% found this document useful (0 votes)
18 views5 pages

In C, Java or Some Other Programming Languages, A Variable Is An Identifier or A Name, Connected To Memory Location

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views5 pages

In C, Java or Some Other Programming Languages, A Variable Is An Identifier or A Name, Connected To Memory Location

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Variable

In C, Java or some other programming languages, a variable is an identifier or


a name, connected to memory location.
a = 30
10 b = 10 c = 20
a b c
10
30 10 20
12114 12115 12117

y=a
y
30
12678
Variable
In Python, a variable is considered as tag that is tied to some value. Python
considers value as objects.
a = 10 b = 10 a = 20
a b a
10 10 20
12114 12115 12117

y=a
y
20
12678
Variable
In Python, a variable is considered as tag that is tied to some value. Python
considers value as objects.
a = 10 a = 20
a a
10 20
12114 12115

Since value 10 becomes unreferenced object,


it is removed by garbage collector.
Rules
• Every variable name should start with alphabets or underscore (_).

• No spaces are allowed in variable declaration.

• Except underscore ( _ ) no other special symbol are allowed in the middle of the variable
declaration

• A variable is written with a combination of letters, numbers and special characters _


(underscore)

• No Reserved keyword
Examples
Do Don’t
• A • and
• a • 15name
• name • $city
• name15 • Full$Name
• _city • Full Name
• Full_name
• FullName

You might also like