TRAINING DETAILS Training Institute : CEG Jaipur Mode of Training : Online Starting Date : 04-07-2022 End Date : 04-08-2022 2
TOPICS TO BE DISCUSSED Introduction & Installation Python Python History & Version Python Features Python Application Variable Keywords Data Type List & Tuples Python Loop Operator 3
Introduction Python is a popular programming language. Python is a dynamic, interpreted language. It was created by Guido van Rossum , It was released in 1991. 4
Installation python Visit the link https://www.python.org/downloads/ Step1:Select the python version to download. Step2: Click on the download button. Step3: Click on the install now. Step4: Installation in process. 5
PYTHON HISTORY Python was conceived in the late 1980s by Guido van Rossum at Centrum Wiskunde & Informatica (CWI) in the Netherlands as a successor to the ABC programming language. 6
Version There are two major python versions- Python 0.9.0 (Feb 1991) Python 1.0 (1994) Python 2.0(Oct 2000) Python 3.0(Dec 2008) 7
Python Features Easy to Learn and Use – Less development time Expressive Language Free and Open Source Large Standard Library Portable - works on Windows/Linux/Mac 8
Python Application 1) Web Applications 2) Desktop GUI Applications 3) Software Development 4) Business Applications 5) 3D CAD Applications 6) Scientific and Numeric 7) Audio or Video-based Applications 9
Variable Variable is a container to store a value. Rules to define variable A variable name can contain alphabets, digit and underscore. A variable name can only start with an alphabet and underscore. A variable can’t start is allowed to be used inside a variable name. Eg . Gpc , Gpc2, Gpc_12 etc. 10
Keywords Keywords are reserved word in python. These reserved words can’t be used as function name or any identifier. 11
12 Data Type Data type determine the type of data a variable will hold. Every variable which is used in the program must be declared as what data-type it is. Data type specify how and what type of data enter in our program. Python provide various standard data types that define the storage method on each of then. 12
List & Tuples List Python Lists are containers to store a set of values of any data type. The list can contain different types of elements such as int , float , string , Boolean , etc . List method: 1. sort ( ) - updates the list to [ 1,2,7,8,15,21 ] 2 . reverse ( ) - updates the list to [ 15,21,2,7,8,1 ] 3. append ( 8 ) adds 8 at the end of the list 4. insert ( 3,8 ) - This will add 8 at 3 index 5. pop ( 2 ) - It will delete the element at index 2 and return its value 6 . remove ( 21 ) - It will remove 21 from the last 14
Tuples Tuples are a data structure that is similar to that of lists in Python but are often lesser-known or interacted with . They share the same characteristics of lists in that they are ordered and indexable but they different in that they are immutable and that they are created using () notation rather than [] notation . Tuple method: Count (_) :- It will return the number of times1occurs Index(_) :- It will return the index of the first occurrence of 1 15
Python Loop We can run a single statement or set of statements repeatedly using a loop command . The following sorts of loops are available in the Python programming language. While loop: while (expression ) { statements increment/decrement statement } For loop: Syntax of for Loop for value in sequence: {loop body} 16
17
Python Operators The operator can be defined as a symbol which is responsible for a particular operation. Operands1 Operator Operands2 Ex. a+b 18
Program To Subtract No. a=input(“Enter the first number\n”) b= input(“Enter the second number\n”) a= int (a) b= int (b) Print(“Subtract of your given number is ”,a-b) Output Enter the first number 8 Enter second number 5 Subtraction of your given number is :3 20