Python Glossary

Python Glossary

General Terminologies in Python:

Below are the general terms which you will come across while working with Python. So it’s a good practice to know them and embrace them so that you can feel confident in the coming times.

  • High-level language: Designed to be easy for humans to read and write.
  • Interpret: Execute a program by translating it one line at a time. Python is an interpreter language.
  • IDLE: Integrated Development and Learning Environment. This includes the basic packages and concepts of an IDE in addition to learning and educational purposes.
  • IDE: Integrated Development Environment. This is a software environment that usually consists of a software development package containing Code Editor, Builds Automation, Tools, and Debugger.
  • Debugging: The process of finding and removing programming errors.
  • Indentation: Indentation refers to the spaces at the beginning of a code line. Python uses 4 spaces or 1 Tab space for indentation. We do not use ‘{ }’ in Python. We indent the block of code after using a ‘:’.
  • Comments: Comments are code lines that will not be executed. We use ‘#’ to comment on a single line in Python. They are used for mentioning memos that are helpful for the user to understand the code. Generally, it’s a good practice to comment on the code when working in a team.
    #taking values form the user – single line comment
    a = input(‘Enter a number: ‘)
  • Multi-Line Comments: Multi-Line Comments are used to comment on multiple lines at once. Unlike ‘#’, we use ‘’’ ‘’’ (triple quotes) for multi-line comments.
    ‘’’
    we will input a single int value from the user
    Multiply it with 5 an return a value
    ‘’’
    a = input(‘Enter a number: ‘)
    print(a*5)
  • Block: Section of code which is grouped together. In Python Programming, we indent the block of code with 4 spaces or 1 Tab.
  • Index: Number the elements as per the order. Always starts with ‘0’. It is very helpful when we iterate any iterable.
  • Immutable: These are the values that can’t be changed/altered after declaration.
  • Mutable: These are the values that can be changed/altered after declaration.
  • Sequence: a group of items with a deterministic ordering. Their index starts with ‘0’. They are iterable and can be iterated over a loop.
  • Keywords: They are the reserved pre-defined words stored in the memory for pre-defined functionality. They cannot be used as any variable, function, and class names. Some of the keywords are:
    • print()
    • if
    • else
    • for
    • while
    • def
    • int
    • float
    • class
    • input
    • return
    • and
    • is
    • not
    • in
    • list
    • tuple
    • map
    • import
  • PEP 8: A set of recommendations on how to write Python code. It’s a style Guide.
  • Zen of Python: When you type “import this”, Python’s philosophy is printed out.

Zen Of Pythons

>>> import this

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

What is PEP-8?

  • PEP stands for ’Python Enhancement Proposal’.
  • It is Python’s style guide. It’s a set of rules for how to format your Python code to maximize its readability.
  • It’s a good practice to read PEP-8 once in a while to make your code look good and professional. It brings International Developer standards to your coding practice.

Read PEP-8 here: https://www.python.org/dev/peps/pep-0008

Get started with Python: What is Python? | Variables in Python | Data & Data-Types in Python

Follow us on:

Source: Platforuma

Leave a Comment

Your email address will not be published. Required fields are marked *

EXTRA ₹999 OFF on Lock-Down Live Learning!

Join Now!
X myStickymenu