Title: Machine Learning With Python & Stats | 100% Job | InsideAIML
1INTRODUCTION TO PYTHON PROGRAMMING
2Google (Youtube) Facebook (Tornado)
Dropbox Yahoo NASA IBM Mozilla Quora Instagram
(Django) Reddit
3Search algorithms Log analysis Google Data
Python Client Library Google APIs Client Library
for Python Google AdWords API Python Client
Library Machine Learning Robotics projects
4(No Transcript)
5NAME IS BASED ON A BBC COMEDY SERIES FROM THE
1970S
Monty Python's Flying Circus
Guido van Rossum December 1989
6Python is used across domains such as
Scripting Testing Web Development IoT
Programming Data Science
7Programming is error-prone! Programming errors
are called bugs
The process of tracking them down is called
debugging
8Easy-to-learn
Python has few keywords, a simple structure, and
a clearly defined syntax. Easy-to-read Python
code is more clearly defined and visible to the
eyes. Easy-to-maintain Python's source code is
fairly easy to maintain. A broad standard
library Python's bulk of the library is very
portable and cross-platform compatible on UNIX,
Windows, and Macintosh. Interactive Mode Python
has support for an interactive mode that allows
interactive testing and debugging of snippets of
code. Portable Python can run on a wide variety
of hardware platforms and has the same interface
on all platforms.
9Extendable
You can add low-level modules to the Python
interpreter. These modules enable programmers to
add to or customize their tools to be more
efficient. Databases
Python provides interfaces to all major
commercial databases. GUI Programming Python
supports GUI applications that can be created and
ported to many system calls, libraries, and
windows systems, such as Windows MFC, Macintosh,
and the X Window system of Unix. Scalable Python
provides a better structure and support for large
programs than shell scripting.
10Portability
A property of a program that can run on more than
one kind of computer.
Interpret To execute a program in a high-level
language by translating it one line at a
time. Compile To translate a program written in
a high-level language into a low-level language
all at once, in preparation for later execution.
11(No Transcript)
12(No Transcript)
13- A program is a sequence of instructions that
specifies how to perform a computation. - Input Get data from the keyboard, a file, or
some other device. Output Display data on the
screen or send data to a file or other device. - Process
- Math Perform basic mathematical operations like
addition and multiplication. - Conditional execution Check for certain
conditions and execute the appropriate code. - Repetition Perform some action repeatedly,
usually with some variation.
14(No Transcript)
15(No Transcript)
16HTTPS//REPO.ANACONDA.COM/ARCHIVE/
17Numbers
- int (signed integers)
- They are often called just integers or int, are
positive or negative whole numbers with no
decimal point. - long (long integers )
- Also called long, they are integers of unlimited
size, written like integers and followed by an
uppercase or lowercase L. - float (floating point real values)
- Also called floats, they represent real numbers
and are written with a decimal point dividing
the integer and fractional parts. Floats may also
be in scientific notation, with E or e
indicating the power of 10 (2.5e2 2.5 x 102
250). - complex (complex numbers)
- Are of the form a bJ, where a and b are floats
and J (or j) represents the square root of -1
(which is an imaginary number). The real part of
the number is a, and the imaginary part is b.
18- Variables are reserved memory locations that are
used to store values and are referenced by a
name. - Example Assigning a contact number and
referencing it by a contact name - Syntax to define a variable is as follows
variableName value - Example phoneNumber 12345
19Variable name should start with an alphabet or
underscore (_) followed by any number of
alphabets, digits and underscores Variable names
are case sensitive. Example phoneNumber is
different from PhoneNumber and phonenumber
Variable name cannot be a reserved name Example
print, if, for, etc Variable name cannot contain
any special character other than underscore
20Int Float Boolean String
21List , List comprehension Tuple Dictionary
22Syntax error Semantic Error Runtime Error
23While loop syntax- while(condition)
For loop syntax for i in range(0,n)
24A collection of built-in modules, each providing
different functionality beyond what is included
in the core Python. import math math.sqrt(16)
math.factorial(10) These are called as fruitful
functions in python.
25Functions are created to make calculations easy
to reuse The general form of a function call is
ltltfunction_namegtgt(ltltargumentsgtgt) An argument is
an expression that appears between the
parenthesis of a function call. The number
within parenthesis in the below function call is
argument.
26abs(-10) abs(-10.5) abs(10.5)
27Rules to execute a function call Evaluate each
argument one at a time, working from left to
right. Pass the resulting values into the
function. Executes the function. The result is
obtained. abs(-7) abs (3) pow(abs(-2),
round(3.2))
28X input(Enter an expression) Multiple
assignments are also possible Ex x,y 3,4 x,y
map(int, input().split())
29- def f1()
- print(Inside the function) f1()
30- def f1(number)
- print(number) F1(5)
31def add() print(Enter 2 numbers to add) a
int(input(1st number)) b int(input(2nd
number)) return(ab) result
add() print(After addition result)
32numint(input("Enter the number")) fact1 for i
in range (1,num1) factfacti print(fact)
33def fact(num) fact1 for i in range (1,num1)
factfacti print(fact) return
fact numint(input("Enter the number")) fact(num)
34def fact(num) if(num1) return(1)
else return numfact(num-1) numint(input("Enter
the number")) print(fact(num))
35Strings are a collection of characters. They are
enclosed in single or double-quotes. Eg
Climate is pleasant 1234 _at_
36Operators overloading are available in default.
3a aaa aa aa a 3 will give
synatax error (you cannot add a string and a
number) a 3 a3 aa will give a
syntax error.
37Indexing is used to extract individual characters
from a string Indexing in python starts from
0. S welcome S0 w S1 e .
38Slicing is taking subsets from a string. Lower
limit is inclusive where as Upper limit is
exclusive. Swelcome S02 ?? S0 ?? S3
?? S ??? S04??
39a in ssn ss in ssn Replacing a
string Text Python is easy Text
Text.replace(easy , easy and powerful)
40Explore the other functions - Assignment
41Write a python function to find the max of 3
numbers Check whether a number is palindrome
using function Check whether a string is
palindrome using function
42Write a Python function that accepts a string and
calculate the number of upper case letters and
lower case letters