D R S H YA M N C H AW D A

Similar documents
Lecture 27. Lecture 27: Regular Expressions and Python Identifiers

Variable and Data Type I

CHAPTER 2: Introduction to Python COMPUTER PROGRAMMING SKILLS

Chapter 3 : Informatics Practices. Class XI ( As per CBSE Board) Python Fundamentals. Visit : python.mykvs.in for regular updates

CSCE 110 Programming I Basics of Python: Variables, Expressions, Input/Output

Variable and Data Type I

Short, Unique and Mysterious

Basic Syntax - First Program 1

Introduction to Python

ENGR 101 Engineering Design Workshop

CSCE 110 Programming I

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu)

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu)

Chapter 2 Getting Started with Python

CMSC 201 Computer Science I for Majors

And Parallelism. Parallelism in Prolog. OR Parallelism

SOFT 161. Class Meeting 1.6

Getting Started. Office Hours. CSE 231, Rich Enbody. After class By appointment send an . Michigan State University CSE 231, Fall 2013

Getting Started with Python

Fundamentals of Programming (Python) Getting Started with Programming

Introduction to Scientific Python, CME 193 Jan. 9, web.stanford.edu/~ermartin/teaching/cme193-winter15

Introduction to Python, Cplex and Gurobi

PYTHON PROGRAMMIN CONCEPT. Learn Python Programming

Introduction to Python

Introduction to Python Part 1. Brian Gregor Research Computing Services Information Services & Technology

Table of Contents EVALUATION COPY

Outline. Simple types in Python Collections Processing collections Strings Tips. 1 On Python language. 2 How to use Python. 3 Syntax of Python

Basic Concepts. Computer Science. Programming history Algorithms Pseudo code. Computer - Science Andrew Case 2

Chapter 2. Python Programming for Physicists. Soon-Hyung Yook. March 31, Soon-Hyung Yook Chapter 2 March 31, / 52

PYTHON FOR KIDS A Pl ayfu l I ntrodu ctio n to Prog r am m i ng J a s o n R. B r i g g s

Review. Input, Processing and Output. Review. Review. Designing a Program. Typical Software Development cycle. Bonita Sharif

Jython. secondary. memory

Python BASICS. Introduction to Python programming, basic concepts: formatting, naming conventions, variables, etc.

STEAM Clown & Productions Copyright 2017 STEAM Clown. Page 1

Beyond Blocks: Python Session #1

06/11/2014. Subjects. CS Applied Robotics Lab Gerardo Carmona :: makeroboticsprojects.com June / ) Beginning with Python

Senthil Kumaran S

PYTHON- AN INNOVATION

Flow Control: Branches and loops

There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals:

Revision of Basics of Python

Scientific Computing using Python

Webgurukul Programming Language Course

Here n is a variable name. The value of that variable is 176.

Babu Madhav Institute of Information Technology, UTU 2015

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

Introduction to Python. Prof. Steven Ludtke

Introduction to Python! Lecture 2

Introduction to Problem Solving and Programming in Python.

Chapter 2 Writing Simple Programs

Programming with Python

Getting started with programming For geospatial data analysis. Robert Hijmans UC Davis

Scripting Languages. Python basics

The current topic: Python. Announcements. Python. Python

Introduction to Python

PYTHON NUMPY TUTORIAL CIS 581

Play with Python: An intro to Data Science

PROGRAMMING FUNDAMENTALS

[Software Development] Python (Part A) Davide Balzarotti. Eurecom Sophia Antipolis, France

Interactive use. $ python. >>> print 'Hello, world!' Hello, world! >>> 3 $ Ctrl-D

Lecture 1. basic Python programs, defining functions

Chapter 4 : Informatics Practices. Data Handling. Class XI ( As per CBSE Board) Visit : python.mykvs.in for regular updates

Introduction to programming with Python

Python Training. Complete Practical & Real-time Trainings. A Unit of SequelGate Innovative Technologies Pvt. Ltd.

Lecture 0. Introduction to Python. Randall Romero Aguilar, PhD II Semestre 2018 Last updated: July 12, 2018

Real Python: Python 3 Cheat Sheet

Interactive use. $ python. >>> print 'Hello, world!' Hello, world! >>> 3 $ Ctrl-D

Programming in Python

Python Workshop. January 18, Chaitanya Talnikar. Saket Choudhary

JatinSir - Mastering Python

Key Differences Between Python and Java

SI Networked Computing: Storage, Communication, and Processing, Winter 2009

Variables, expressions and statements

Computer Science 217

High Level Scripting. Gino Tosti University & INFN Perugia. 06/09/2010 SciNeGhe Data Analysis Tutorial

Python. Jae-Gil Lee Based on the slides by K. Naik, M. Raju, and S. Bhatkar. December 28, Outline

Data Types and Conversion

Crash Dive into Python

About Variables in Python F E B 1 1 T H

Selection statements. CSE 1310 Introduction to Computers and Programming Alexandra Stefan University of Texas at Arlington

MAS212 Scientific Computing and Simulation

Princeton University COS 333: Advanced Programming Techniques A Subset of Python 2.7

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

Algorithms and Data Structures

DaMPL. Language Reference Manual. Henrique Grando

lambda forms map(), reduce(), filter(), eval(), and apply() estimating π with list comprehensions

Python Basics. Nakul Gopalan With help from Cam Allen-Lloyd

Welcome to Python 3. Some history

Introduction to Programming

CS177 Python Programming. Recitation 2 - Computing with Numbers

DEPARTMENT OF MATHS, MJ COLLEGE

Coral Programming Language Reference Manual

Chapter 3 : Computer Science. Class XI ( As per CBSE Board) Data Handling. Visit : python.mykvs.in for regular updates

Large-Scale Networks

CIS192 Python Programming. Robert Rand. August 27, 2015

Control flow statements

Some material adapted from Upenn cmpe391 slides and other sources

Python for ArcGIS. Lab 1.

Introduction to Python

Python Basics. 1 of 7 9/5/2018, 8:51 AM. txt1 = "ada lovelace, english mathematician and writer" print(txt1)

Transcription:

PYTHON D R S H YA M N C H AW D A

HISTORY Guido Van Rossum Amoeba distributed operating system group Rossum was fan of a comedy series from late seventies.

WHO USE PYTHON? Google - Python is one of the key language used in google. NASA - Johnson Space center uses Python in its Philips - Philips uses Python for the Integrated Planning System as the standard scripting sequencing language language Quora - Quora also chose Python for its Walt Disney Feature Animation - Walt Disney development Feature Animation is also using Python to make their animation production system more efficient in scripting. Instagram - Instagram also uses Python for its backend YouTube, DropBox, Pinterest

APPLICATION OF PYTHON Web Applications You can create scalable Web Apps using frameworks and CMS (Content Management System) that are built on Python. Some of the popular platforms for creating Web Apps are: Django, Flask, Pyramid, Plone, Django CMS.

APPLICATION OF PYTHON Scientific and Numeric Computing There are numerous libraries available in Python for scientific and numeric computing. There are libraries like: SciPy and NumPy that are used in general purpose computing. And, there are specific libraries like: EarthPy for earth science, AstroPy for Astronomy and so on.

APPLICATION OF PYTHON Scientific and Numeric Computing machine learning, data mining and deep learning.

APPLICATION OF PYTHON Image Processing and Graphic Design Applications: Python has been used to make 2D imaging software such as Inkscape, GIMP, Paint Shop Pro and Scribus.

APPLICATION OF PYTHON Games Python has various modules, libraries and platforms that support development of games. PySoy is a 3D game engine supporting Python 3, and PyGame provides functionality and a library for game development.

2 REASONS TO CHOOSE PYTHON AS FIRST LANGUAGE Easy to write It's easier to understand and write Python code. print( Hi ) A=5

2 REASONS TO CHOOSE PYTHON AS FIRST LANGUAGE Not overly strict There is not need to define the type of a variable in Python. No semicolon at the end of the statement. Python enforces us to proper indentation.

2 REASONS TO CHOOSE PYTHON AS FIRST LANGUAGE Not overly strict There is not need to define the type of a variable in Python. No semicolon at the end of the statement. Python enforces us to proper indentation.

ADVANTAGES Interpreted Object-Oriented Portable Extendable

print print ("Hello World!") print ("I am Shyam Sir") print ("Hum hai rahi pyar ke!!!!") print Hi!!!!

print x=5 y=20 print("x = ",x," Y = ",y) print("add = ",(x+y)) print("sub = ",(x-y)) print("multi = ",(x*y)) print("div = ",(x/y))

x,y,z=10, ram,20 x=y=z=200 print

print a = "Hey All of you" b = 100 pi = 3.14 print("type of A = ",type(a)) print("type of B = ",type(b)) print("type of PI = ",type(pi))

Identifiers rules Identifiers can be a combination of letters in lowercase (a to z) or uppercase (A to Z) or digits (0 to 9) or an underscore (_). myclass, a_1,firstname_last_name Keyword should not be used as an identifier name. Identifiers are unlimited in length. Case is significant.

Keywords False class finally is return None continue for lambda try True def from nonlocal while and del global not with as elif if or yield assert else import pass break except in raise

Variable x=y=z=50 del x,y,z a,b,c=5,10, ram name='ram a="raj Pi=3.14

Standard Data Types Numbers - int,long, float, complex String List Tuple Dictionary

total = a + \ b + \ c total = (1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9) Some

Some word = 'word sentence = "This is a sentence." paragraph = """Multiline statements you can write here""

Comments # Single Line Comment print "Hello, Python!" # Single Line Comment #Multiline Comment #Multiline Comment #Multiline Comment

Operators Arithmetic Operators Comparison (Relational) Operators Assignment Operators Logical Operators Bitwise Operators Membership Operators Identity Operators

Arithmetic Operators a+b,a b,a*b,a/b,a%b a**b exponential 9//2 = 4 and 9.0//2.0 = 4.0 Floor Division

Arithmetic Operators a+b,a b,a*b,a/b,a%b a**b exponential 9//2 = 4 and 9.0//2.0 = 4.0 Floor Division

Comparison Operators < > ==!= >= <=

Logical Operators and or not

Identity Operators x = 'Hello world' print('h' in x) print('hello' not in x)

String X= Ram Y= Laxman Z=x+ + y X= Khadak sing ke khdak ne se print(x[2]) //slice function print(x[0:2]) print(x[0:5]) print(x[2:]) print(x[-2])

String X= Ram Y= Laxman Z=x+ + y X= Khadak sing ke khdak ne se print(x[2]) //slice function print(x[0:2]) print(x[0:5]) print(x[2:]) print(x[-2])

X= Ram Y= Ram X= Ram\ s Y= Ram\ s String

Place Holders sen="hello %s,good Morning print(sen%('ram )) //placeholder arr=['ram','laxman','jack ] for i in arr: print(sen%(i)) sen="hello %s %s,good Morning print(sen%("narendra","modi")) sen="i am %s and my age is %d sen%("ram",21)

If elif else

If elif else a=int(input("enter the value")); b=int(input("enter the value")); c=int(input("enter the value")); if(a>b and a>c): print("a is max",a) elif (b>a and b>c): print("b is max",b) else: print("c is max",c)

For loop a=int(input("enter the value")); for b in range(1,11): print(b); for val in "string": if val == "i": break print(val) print("the end")

While sum = 0 i = 1 while i <= n: sum = sum + i i = i+1 print the sumprint("the sum is", sum)

Bool() and Abs() bool(5) abs(-5) eval("5+2-3") program = 'a = 5\nb=10\nprint("Sum =", a+b) exec(program)

ANY QUERY?