Menu

A learning series of Python , Day-2
📰

A learning series of Python , Day-2

DEV Community: python·Ajay·about 20 hours ago
#Ce6HXHHd
#devtopython#devto#dev#valid#invalid
Reading 0:00
15s threshold

What is Identifier ?

A name in python program is known as Identifier / Reference variable /variable

A used-defined name to discribe something to machine.

Rules of declaring Identifiers

Starts with alphabets[lowerCase / upperCase ]

Digits are permitted , but should not starts with digits

Using UnderScore(_) -Should not to use reserved Keywords

###Valid Identifiers Name = " Ajay " name = " Ajay " name1 = Ajay " newName = " Ajay " New_name = " Ajay " _Name = " Ajay " __Name = " ajay " __name__ = " ajay "

Enter fullscreen mode

Exit fullscreen mode

###Invalid Indentifers 1 name = " ajay " new name = " ajay " class =" ajay " # class is the reserved keyword new-Name = " ajay "

Enter fullscreen mode

Exit fullscreen mode

Rule of UnderScore in Python

_name --->(#private):

A single underscore indicates that a variable or method is intended for internal use.

Please treat this as internal

class Student : def __init__ ( self ): self . _marks = 90

s = Student () print ( s .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.