If the name consists or more than one words, write all words together capitalizing each new word.Ī few examples: AnimalClass, CalendarClock etc.This rules of this convention are as follows: In Python we use the so called 'CapWords' convention for the naming of our classes. One of the first things to point put is that you should'nt name your variables/functions with one letter when the letter is the lowercase L and uppercase I or uppercase O, as these letters can often be confused with 1 and 0 respectively. We are now going to dive a little deeper and go through naming conventions in Python in detail. We've already briefly discussed naming conventions in Python in on of our first tutorials about variables. Naming convetnions should be used when naming variables, functions and classes. Naming conventions are rules, which although not mandatory allow us to keep our code clean and Pythonic. This will cause an IndentationError and will not allow your code to compile. Irregular use of tabs and spaces which causes an error in Python
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |