Wednesday, September 25, 2024

Python Introduction

Python Introduction :-

Python was created by Guido van Rossum that was released in 1991 used for web development(server side), software development, mathematics, system scripting and many more. It is a high level language that require interpreter to run the program. you can run the python program using two modes. 

The first one is interactive mode means where the interpreter displays the result immediately using prompt(<<<), but the drawback of this mode is that you can not save the code for future use.

The second mode is script mode in which you can type your code and save it for future use to run again and again. you can type the program in a file and use the interpreter to run the program. you can modify and reuse this.

Example :- 

Code:-

>>>print "Hello form Amritansh Computers"

Output:-

Hello from Amritansh Computers

Variables and Types :-

We use variables to capture data in programming language that can be manipulated to provide information. everything is objects and they have three characteristics i.e. 

An Identity - means its name or you can say the address in memory.

A type - means the type of value that is stored in that particular location.

A Value- any number or letter or string i.e. stored on that identity location.

Keywords :-

Keywords are the reserve word in programming language that have a special meaning used to recognize the structure of program, so you can not use that keyword as an identifier in your program.  

some python keywords are - 

and , del, from, not, while, as , elif, global, or, with, assert, else, if, pass, yield, break, except import, print, class, exec, in , raise, continue, finally, is return, def, for, lambda, try.

Operators and operands.

operators are used for computation like addition, subtraction, multiplication, division and the values on which operators are applied is known as operands. there are some kind of operators that are Arithmetic, Relational, Logical and Assignment operator. 

Arithmetic operators - +, -, *, /, %, **, and //.

Relational operators: <, <=, >, >=, != or <> and ==. 

 Logical operators: and, or, not

 Assignment Operator: =, +=, -=, *=, /=, %=, **= and //=


>



No comments:

Post a Comment

Autonomous Vehicles

Autonomous Vehicles Autonomous vehicles are cars or trucks that can drive themselves without needing a human to control them. They use advan...