"PYTHON" - INTRODUCTION AND ASSIGNING VALUES



# What Is Python ?
  • Python is a popular programming language. It was created by Guido van Rossum in 1991.
  • Python is a general-purpose, dynamic, high-level, and interpreted programming language. It supports Object Oriented programming approach to develop applications. 
  • It is simple and easy to learn and provides lost lots of high level data structure.
  • Python is used for :
                1.     Web development (server side),
                2.     Software development,
                3.     Mathematical calculations,
                4.     System scripting.


IMG Source: Tap Academy


............................................................................................................................................................................................................................................................................................................................


# Where is Python used ?

        1.     Data science
        2.     Desktop applications
        3.     Mobile applications
        4.     Software development
        5.     Artificial intelligence
        6.     Web applications
        7.     Computer vision or image processing applications
        8.     Speech recognition
        9.     Gaming
        10.    Networking

............................................................................................................................................................................................................................................................................................................................

# Why we should prefer to learn Python ?

        1.     Easy to use and learn.
        2.     Open source language.
        3.     Extensible with other languages.
        4.     Career opportunities.
        5.     High demand.
        6.     Increased productivity.
        7.     Can handle big data collection.

............................................................................................................................................................................................................................................................................................................................


# Python Syntax :

1.     Python Syntax can be executed by writing directly in the command line.

 >>> print("Hello, World!") 
 Hello, World!              

2.     It can also be executed by creating a python file on the server, using the .py file extension and running it in the command line

 C:\Users\Your Name>python myfile.py 


............................................................................................................................................................................................................................................................................................................................


# Python Variables :

  • In python, variables are created when you assign a value to it.
  • Python has no command for declaring a variable.
  • Three simple steps to assign a value :
            1.     Take a variable of valid name
            2.     Use equal to sign (=)
            3.     Enter the value of any valid data type you want to assign to any particular 
                     variable.

 x = 5                    # Datatype : Integer 
 y = " Hello World! "     # Datatype : String  
 z = 15.57                # Datatype : Float   

  • String variables can be declared either by using single quotes or double quotes.
  • Variable names are case-sensitive.                                                                                                           
     A = 5                    # Datatype : Integer 
     a = " Hello World! "     # Datatype : String  
     # A will not overwrite a                      

    • Variables do not need to be declared with any particular type and can even change type after they have been set.
    • If the same variable is assigned with the two values of different data types then the value which is assigned later on will only be assigned to that variable.

     x = 5                    # Datatype : Integer     
     x = " Hello World! "     # Datatype : String      
     print(x)                 # Output = Hello World!  
                                                       
     # Output will not be 5 because Hello World will   
     overwrite 5                                       



    ............................................................................................................................................................................................................................................................................................................................


     // * THANK YOU *// 

    Comments