Python very basics thing, topics

 Python very basics thing we are discuss through this post.

What is Python and Programming Language: 

In simple word Python is a programming Language.
 

What is the purpose of programming Language and why we use it. 
 
When a user give the instructions to the computer for doing certain tasks. The user give instruction to the computer.

Programming language is a medium by which we give instructions to the computer user for doing a job.

How Python utilized: we write some code in python. Not in Zero and One. Computer understand only Zero and One.

Assembly language: 
This is used to keep instructions to the computer using some sequence Zero and One. Assembly language is a Low Level Language.

Why  Low Level Language: This language can interact directly to the computer. Using this language to give instruction to the computer.

Assembly Language:
An assembly language is a type of low-level programming language that is intended to communicate directly with a computer's hardware. Unlike machine language, which consists of binary and hexadecimal characters.

An assembly language is a low-level language. It gives instructions to the processors for different tasks. It is specific for any processor. The machine language only consists of 0s and 1s.

An assembly language is a type of low-level programming language that is intended to communicate directly with a computer's hardware. Unlike machine language, which consists of binary and hexadecimal characters, assembly languages are designed to be readable by humans.


High-Level Language:
A high-level language (HLL) is a programming language such as C, FORTRAN, or Pascal that enables a programmer to write programs that are more or less independent of a particular type of computer. Such languages are considered high-level because they are closer to human languages and further from machine languages.

High level programming Language Example: Python, C++,, Java, Ruby, C#, Delphi, Perl, PHPand more.



Interpreter:

Convert Python code to Binary Language or instructions in the form of  Zero and One.
 Convert python code in  the form of  Zero 0s and One 1s.

 

Compiler VS Interpreter: 

Both of the task Compiler and Interpreter are same. Both are do convert high level language to a binary form first and then executed.
 
executing happens line by line.


Syntax : 

The Python syntax defines all the set of rules that are used to create sentences in Python programming. 
 or
The syntax of the Python programming language is the set of rules that defines how a Python program will be written and interpreted.
 
For example – We have to learn grammar to learn the English language. In the same way, you will need to learn and understand the Python syntax in order to learn the Python language.

 

Declaration of Variable: 

Variable store any value that you want to print and work.
Now fact is what kinds of value will be there 


    a=2
    # # Here 'a' is a variable.
    b=5
    # # Here 'b' is a variable.
    c=a+b
    print(a,b)
    print(a+b)
    print(c)




Addition (+): 

'+'  this is Addition
 

Substraction (-):

'-'  this is Subtraction.

Division (/):

 '/' this is Division.

Multiplication (*): 

 '*' this is Multiplication

 

Remainder (%) : 

a mod b (a%b)
 
   
    a=9
    b=5
    c = a % b      # %-------> mod
    print(c)
    print(a%b)
 
    Output: 4 
 

 

Power (^) : 

a^b (a power b) 
 
 
 # This is Power

    a = 5
    b = 2
    c = b^a
    print(c)
     
    Output: 7 
 
 
   
 

 Double star (b**a)

  
    a = 5
    b = 2
    c = b**a
    print(c)

    # output: 32
 

Quotient:

 Double Slash (a//b)
 

    a = 5
    b = 2
    print(a//b)

    # output: 2



 Others

  
  a = 7
    print("Value of a is", a)


 



 

 

 

 

 

 

 

 

 

 

إرسال تعليق (0)
أحدث أقدم