Python-Intorduction to coding Technology.pptx

jayapal385 9 views 40 slides Jul 18, 2024
Slide 1
Slide 1 of 40
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40

About This Presentation

python


Slide Content

Karthik B - Founder and CEO skynoveau.in [email protected] Ph. No: 9360375911

Introduction Features Installation Hello world Variable declaration Data types Operators Conditional statements Loops Array Frozenset Array List Tuple Set Dictionary Topics List Introduction Collection in Python Oops in Python

Introduction

Introduced by Guido Van Rossum in 1991. In late 1980s , Guido van Rossum was working on the Amoeba Distributed Operating System Group He wanted to use an interpreted language like ABC ( ABC has simple easy to understand Syntax ) that could access the Amoeba System calls . So , he decided to create language that was extensible . This led to design of a new language which was later named Python It is an interpreted language. What is Python Why the name Python Rossum was fan of “ Monty Python’s Flying Circus “ . This circus was in his living country So, the name “Python” was adopted from the same series “Monty Python’s Flying Circus “ Introduction

Features

Why Choose Python Drawbacks Open Source Simple and easy Not overly strict ( ; ) IOT Opportunities Object Oriented Week in mobile computing and browser Design Restrictions ( Indentation-Base Syntax ) Software Companies That Use Python : Industrial Light Magic (UFX, VFX) Google Facebook Instagram Spotify Quora Netflix Dropbox Reddit Features Applications : Web Applications : (server-side / Frameworks - Django, Flask, Pyramid, Plone, Django CMS ) Software development: ( Windows softwares ) Scientific and Numeric Computing Data science Video game Development Machine Learning Artificial Intelligence Digital Image Processing

Installation

https://www.python.org/downloads/ Installation :

Hello World

Hello world built-in function in Python used to display messages on the console string contain a text

Variable declaration

A = 5 A = 5 _a = 5 a_ = 5 __a = 5 Mycourse = 5 my_course = 5 _my_course = 5 MYCOURSE = 5 Mycourse2 = 5 myCourse = 5 Variable Possible ways 3a = 5 3mycourse = 5 $mycourse = 5 Mycourse$ = 5 my$course = 5 Variable name s hould not start with numbers Variable name Should not use Special charact e r Wrong ways Declaration Variable is used to store the value on system memory

Data Types

Data types Numeric Boolean Sequence type Set Dictionary Complex range Set Forzenset String To generate the sequence number from the range value To make immutable 2, 5, 7 2.0 , 5.2, 7.5 2 + 5 j true or false “ name “ Tuple List Integer Float Primitive Data Types Non - Primitive Data Types Data Types

Operators

Arithmetics Operators Assignment Operators Comparison Operators Logical Operators Bitwise Operators Special Operators Operators Operators are used to perform the Mathematical calculations in program

Arithmetic operators Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication

Assignment Operators Assignment operators are used to assign values to variables

Comparison operators Comparison operators compare two values/variables and return a boolean result

Logical operators Logical operators are used to check whether an expression is True or False. They are used in decision-making

Bitwise Operators Right Shift ( >> ) : Left Shift ( << ) : Bitwise operators act on operands as if they were strings of binary digits. They operate bit by bit, hence the name.

Skynoveau Technology Identity Operators In Python , is and is not are used to check if two values are located at the same memory location.

Skynoveau Technology Membership Operators In Python, in and not in are the membership operators. They are used to test whether a value or variable is found in a sequence (string, list, tuple, set and dictionary). In a dictionary, we can only test for the presence of a key, not the value.

Control statements

Control statements If statement for loop while loop break continue Decision making statements Looping statements Jump statements The control statement are used to control the flow of execution of the program. This execution order depends on the supplied data values and the conditional logic. Note : Python doesn’t support switch case

Conditional Statements

IF Condition If condition is used to execute the set of statements condition based . condition checks one by one until condition will be true or false. We can decide which statement should be execute or ignore . condition 1 If condition 1 is true, block of code will execute If all condition failed, block of code will execute condition 2 If condition 2 is true, block of code will execute We can write “ if ” block alone. but can’t write “ elif “ block and “ else “ block without “ if “ block . So “ elif “ block and “ else “ block should be followed by “ if “ block . we can write multiple “ elif “ block follow by “ if ” block. but can’t write multiple “ else “ block

Odd or Even number Biggest among two number Biggest among three numbers Positive or negative number Programs based on If condition :

Loops in Python

For Loop In programming, a loop is used to repeat a block of code until the specified condition is met. we can use “ for loop “ when we know how many times loops will execute. Syntax 1 : Syntax 1 : Syntax 2 : Output: data data data initial value end value initial value end value iteration Output: data data end value Output: data data data data

Print the numbers from 1 to 10 Sum of N numbers Sum of odd numbers from 1 to 10 Sum of even numbers from 1 to 10 Sum of 5+9+10 from 1 to 10 Amstrong Prime number Programs based on for loop :

While Loop condition block of code will execute until condition false Output : 3 2 1 we can use “ while loop “ when we don’t know how many times loops will execute Note : Python doesn’t support do while loop

Sum of Numbers Sum of N digit Sum of odd Digit Sum of Even digit Check whether it is palindrome or not ( Ex: 121) Programs based on while loop :

Arrays in Python

Arrays Arrays can store multiple values and Index value start with & end with n-1 In Python, arrays can store the multiple type values in variable Output : [10, 20, 30, 40, 50, 60 ]

Frozenset

Skynoveau Technology frozenset is a kind of immutable set When we declare a set as a frozenset it cannot be modified at any occurrences Output : frozenset

Collections

Array List Tuple Set Dictionary array = [ 10, 12, 15 ] list = [ 10, 12, 15 ] tuple = (10, 12, 15 ) Set = { 10, 12, 15 } dic = { “name” : ”python” } print ( array ) print ( list ) print ( tuple ) print ( set ) print ( dic ) Homogeneous Non-Homogeneous Non-Homogeneous Non-Homogeneous Non-Homogeneous Allow duplicate values Allow duplicate values Allow duplicate values Doesn’t allow duplicate values Doesn’t allow duplicate key ordered ordered ordered Unordered Ordered need to import to use Doesn’t need to import to use Doesn’t need to import to use Doesn’t need to import to use Doesn’t need to import to use Skynoveau Technology Collections

Oops in Python
Tags