Skip to content

Files

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Introduction to Python Programming

print('Hello World')

Where can we use Python?

  1. Desktop Applications (Calculator, Notepad, etc..)
  2. Web Applications (Youtube, Dropbox, Google, Instagram, Quora, Spotify)
  3. Scientific and Numeric Computing (Scipy, Numpy)
  4. Database Applications (Library Management Systems, Pharmaceutical)
  5. Network Applications (Network Sniffer, Network Parameter extraction, Routing Algo's like OSPF)
  6. Developing Games (Battlefield, Sims 4, PUBG)
  7. Data Science (Pandas, Matplotlib, Seaborn, etc)
  8. Machine Learning (scikit)
  9. AI (AIMA - AI: A Modern Approach)
  10. IOT (Raspberry pi, Phillips(works great with low level code in c++))

Features of Python:

  1. Simple and easy to learn
  2. Free and open source
  3. General Purpose and high level programming language
  4. Platform independent
  5. Case Sensitive
  6. Interpreted Language
  7. Dynamically typed
  8. Rich Library
  9. We can write concise code using python

Identifiers

Identifier is a user-defined name in Python like variable name, function name and class name.

Rules to define identifiers:

  1. Allowed characters => Alphabets, Digits and Underscore Symbol
  2. Identifier should never start with a digit
  3. Case Sensitive
  4. No length limit
  5. Can't use reserved words for identifier

Data Types

As we know that python is Dynamically typed programming language, than why do we need to learn about data type at all?

Although python automatically understands the data type, but it is important to know about data types so that we can utilize the power of data structures in future.

Basic Data Types available in python are:

    Numeric - int, float, complex (Immutable)
    Boolean - bool (True/False)
    Strings (Immutable)
    List (Mutable, mostly used to store homogeneous data types)
    Tuple (Immutable, faster compared to List)
    Set (Unordered collection of items, mutable, removes duplicates)
    Dictionary (Unordered collection of Key-Value Pairs, Mutable, Keys are Unique - values may not be unique)

Operators

Operator is a symbol that perform certain operation.

Operators available in python are:

  1. Arithmatic (+, -, *, /, %, //, ***)
  2. Relational (>, >=, <, <=)
  3. Equality (==, !=)
  4. Logical (and, or, not)
  5. Bitwise (&, |, ^, ~, <<, >>)
  6. Assignment (=, +=, -=, *=, /=, etc..)
  7. Ternary
  8. Identity --> is, is not (used for address comparision)
  9. Membership --> in, not in