Introduction to Python

Python, for Experienced Programmers | by Jamie Bullock | Dev ... Basics 

Python is a cross platform programming language, which means it can run on multiple platforms like Windows, Mac, Linux, etc. Python is an open source, which is the main reason it is becoming so popular nowadays. Guido Van Russom is the creator of this language.



It's syntax is easiest of all other languages.

IDE is Integrated Development Environment.

It means that it features in running, supporting and providing an environment for the code.You will never be able to run your code without IDLE.

Python is becoming so popular in following:

  • Image processing
  • Graphic Designing
  • 3D Modelling 
  • Data  Science 
  • Machine Learning 
  • Web Development 
  • Embedded Systems and IOT
  • Android App
  • Automated Jobs
In python, input is always treated as non-numeric(by default), even if it contains digits.

Python 3.0 was released in December 2008 and this the version is designed such that it does not support backward compatibility.

Keywords

Keywords are the reserved words in python.
We cannot use a keyword as a variable name or a function name. There are 33 keywords in python 3.7.

Keywords are case sensitive. Examples are:-
Python Keywords: An Introduction – Real Python

True, False, for, lambda, try, def, del, as, elif, assert, yield, nonlocal, etc.

Identifiers

Identifiers are basically name of functions, variables, classes. They help in differentiating one identity from other. There are some rules for naming them:

1. Identifiers can be combination of alphanumeric characters and underscore.
2. Identifier name should not start with digit.
3. Also, it should not start symbols like @, #, etc.
4. Identifiers can be of any length.
5. Most importantly, keywords cannot be identifiers.

NOTE:
  • Name of class always begin in upper case.
  • Also, print in python is a keyword but a built-in function.
  • Name mangling - since there is a limited support for a valid use-case for class-private members, this mechanism basically avoids clashes of names with names defined by subclasses.

Data-Types


Python is a dynamically typed language. 
When a program runs, data objects in the program are stored in computer's memory for processing.

While some of these objects can be modified at that memory location, other data objects can't be modified once they are stored in the memory.
Python: Mutable vs Immutable. Everything in Python is an object ...
The property of whether or not data objects can be modified in the same memory location where they are stored is called mutability.

If the memory location remains the same when the data object is modified, it means its mutable.

SET is another data-type which is unordered unlike lists and tuples. A set does not allow duplicate objects to be stored, where as same object can appear more than once in list and tuples.


DICTIONARY  is a collection datatype. However it is an unordered collection of items in which each item is a "key:value" pair.
Designing Intelligent Python Dictionaries | by Chaitanya Baweja ...

Dictionary can contain all other datatypes, but they should be immutable.
Also, a key cannot appear more than once in a dictionary. If it appears more than once then only last one will be retained.

Some, built-in functions are :-
  • len( )
  • max( )
  • min( )
  • item( )
  • get( )

How to Write Pythonic Loops – Real Python

Refer to this YouTube video:-


Follow Us On:

  




Comments