UrbanPro
true

Learn Python Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Identifiers in Python Programming

P
Pallavi R.
10 Oct 0 0

Identifiers:

These are the names that are used to identify the variables, functions, classes, modules or other objects. Whenever we define something in python and give it a name then we call it as an identifier.

Identifier Rules:

  1. Identifier cannot be a keyword.
  2. It is case sensitive.
  3. It may contain a single alphabet or a word or alpha-numeric.
  4. It cannot start with a digit, but can have a digit in the middle or last .
  5. It cannot have any other special character apart from ‘_’(underscore).
  6. It cannot start with a space or have a space in the middle.
  7. It can be of any length, but should be meaningful and readable.

Best Practices of Naming Identifiers

  • Use snake_case for variables and functions:

Eg: 

student_name, calculate_total, average_score

  • Use PascalCase for class names:

Eg: 

class StudentDetails:

pass

  • Use UPPERCASE for constants:

Eg:

PI = 3.141

  • Choose meaningful names:

Eg: 

x = 10 # vague
marks_obtained = 10 # better

0 Dislike
Follow 1

Please Enter a comment

Submit

Other Lessons for You

Python Introduction
Python is an object-oriented programming language created by Rossum in 1989. It is ideally designed for rapid prototyping of complex applications. It has interfaces to many OS system calls and libraries...
I

Imran

0 0
0


Python programming - Applications
If you’re thinking of learning Python? Or if you recently started learning it? You may be asking yourself: "What exactly can I use Python for?" There are so many applications for python, but there...

Back Reference In Python Regex
What if your interviewer asks about this? We know Regex have some useful functions like: match ( Ex: re.match(pattern,dataSource) ) search ( Ex: re.search(pattern,dataSource) ) sub ...

How to know if an object is iterable?
An object in python is said to be an iterable if it obeys one of the following two rules:- 1. Object must consist of __getitem__ method 2. Object must consist of __iter__ method. String objects generally...

Sudheer S

0 0
0
X

Looking for Python Training Classes?

The best tutors for Python Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Python Training with the Best Tutors

The best Tutors for Python Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more