In my previous article, I shared some of the details regarding Python and the installation process. If you haven't installed it yet, please use this link and install it. Please check the below link of my previous article,

How to check Python by CMD

TYPES OF RUNNING METHOD

EXTENSION OF PYTHON FILE - Filename.py (ex: add.py)

PYTHON TOOLS

IDE → INTEGRATED DEVELOPMENT ENVIRONMENT

FAMOUS WEBSITES USING PYTHON

  1. Instagram
  2. Google
  3. Spotify
  4. Netflix
  5. Uber
  6. Dropbox
  7. Pinterest

SUPPORTS OF OOPS CONCEPTS

CLASS

Creating the objects.

OBJECT - is a real-world entity [Pen, Book, Bed, Keyboard]

METHOD - like a function [Ex: _int_]

INHERITANCE

A class is derived from another class is called inheritance.

POLYMORPHISM

It is a Graken Language.

Poly=many, morphism =forms

When a process is acting with the different situations differently.

Ex - person – act [school – student], [office – employee].

DATA ABSTRACTION

A process of identifying the essential details and ignoring the non-essential details.

EX - TV Remote.

ENCAPSULATION

A mechanism of hiding the internal details. [security purposes]

EX - Medical capsule.

PYTHON APPLICATIONS

COMPARISON OF JAVA & PYTHON

JAVA PYTHON
Compiled language Interpreted language
Statically Type Dynamically Type
Complex learn Easy learn
Curly braces {} Indentation
Slow running Fast running
High code line Low code line
Low packages
[Inbuild libraries]

Lots of packages
[Inbuild Libraries]

Notepad, NetBeans, Eclipse, Java Python, IDLE, Anacondas, Jupyter, Spyder, Tabula
Spring, Blade Django, Flask.


VARIABLE IN PYTHON

A variable can be used to store some values (in a data format) with a symbolic name. It is to be considered as changeable.

No need to declare that the data type to the variable.

  1. a = 100
  2. a => variable
  3. “= “ => Assignment operator
  4. 100 = > value

IDLE METHOD

  1. Start => IDLE => “window open”
  2. File => new file
  3. Untitled windows will open
  4. File=> save
  5. File name => filename.py [eg: add.py]
  6. press “save”
  7. Now, the file will be saved successfully and can be viewed in the title.
  8. press f5 (or) fn +f5 to run the program

OUTPUT

a,b,c is variables 100,200 is values and finally we are using '+' operator. So, we will get the output of 300.

TOKENS IN PYTHON

Tokens can be defined as the smallest element of a program and it is meaningful to the compiler.

There are some of the types as follows,

KEYWORDS

  1. True, false,
  2. while, for,
  3. if, else, elif,
  4. break, continue, pass,
  5. def, class, return, with
  6. try, except, finally,
  7. import, From, as

IDENTIFIERS

It is a name used to identify a variable, function, class, module, or other objects. Some of the rules are to be specified as follows,

Rules

  1. In this identifier, the first character of the variable must be in the form of an alphabet or underscore (_).
  2. Except for the first character remaining variables may be an alphabet that classifies as lower-case(a-z), upper-case (A-Z), underscore, or digit (0-9).
  3. The name of the identifier may not have any white space or special character (! @, #, %, ^, &, *).
  4. The identifier name must not be similar to any keyword it must be defined with the language.
  5. It must be considered case-sensitive.

Example

LITERALS

  1. String literals
  2. Numeric literals
  3. Boolean literals
  4. Literal Collections
  5. Special literals

String Literal

Numeric literals

Boolean literals

Literal collection

Special Literals

OPERATORS IN PYTHON

Types of Operator

  1. Arithmetic Operators (+, -, /, *, %)
  2. Comparison (Relational) Operators (==, !=, <=, >=, <, >)
  3. Assignment Operators (=, +=, -=, *=, %=, **=, //=)
  4. Logical Operators (and, or, not)
  5. Bitwise Operators (&, |,^ , ~, <<, >>)
  6. Membership Operators (in, not in)
  7. Identity Operators (is, is not)

PRINT & QUOTATION STATEMENT


Next, how to print a statement and types of quotations in Python.

Syntax - print (" ")

Types of quotations

Example

#Print Statements Using Python
#Single Quotation  
print('Hi')  
#Double Quotation  
print("Hello World")  
#Triple Quotation  
print('''Welcome''')  
#Using " "  
print('This is "Python"')  

OUTPUT

Hi

Hello World

Welcome

This is "Python"

PYTHON COMMENTS

Python Comment is a fundamental device for developers. Remarks are for the most part used to clarify the code. Assuming the code has the appropriate clarification, we can undoubtedly understand the projects. In the future, any individual may change the code to make or execute the new model. So, a decent developer should utilize the remark, at that point it can done be in a simple way.

  1. “#” This hash symbol is representing to comments
  2. Single line comments using the # symbol
  3. Multiline comments using triple quotations

I hope you understand. If you have any query please ask me anything. We'll see more in the future.