Slide 1

Slide 1 text

Python for Beginners 19th August, 2017 Nirma University, Ahmedabad Daxeel Soni

Slide 2

Slide 2 text

Agenda •Coding Bag (Tools) •History •Features •Companies using Python •Programming ‣ Variables, data types, operators ‣ Control flow structures ‣ Loops ‣ User defined functions ‣ File operations ‣ Modules ‣ PIP •QnA

Slide 3

Slide 3 text

About Me •Co-lead at Facebook Developers Circles, Ahmedabad •Coach at Django Girls(UK), Ahmedabad Chapter •Hackathon lover. •Selected for Hack the North ’17 hackathon at University of Waterloo, Canada. •HackInOut ’17 1st runner up •In top 100 makers across India for nationwide makers gathering Maker Mela ’17 •Area of work includes APIs, bots, IoT, web. •Building crazy stuffs in python since 2 years. •4th Year engineering student at GTU.

Slide 4

Slide 4 text

Example •Chatbot controlled CNC machine •Tech stack : raspberry PI, arduino, python, openshift cloud •https://devpost.com/software/iot-based-facebook-chatbot-controlled-cnc-machine

Slide 5

Slide 5 text

Coding Bag (Tools)

Slide 6

Slide 6 text

History •In 1980 founded by Guido Van Rossum •The name python belong to popular TV show “Monty Python’s Flying Circus” •Python 2 is popular version •MIT has enrolled python has their first language.

Slide 7

Slide 7 text

Features •Interpreted •Interactive •Object-oriented •Easy to learn •Readable beautiful code •Open source with strong community •Crossplatform •Large collection of library packages

Slide 8

Slide 8 text

Who Uses Python?

Slide 9

Slide 9 text

So, lets do some action!!!

Slide 10

Slide 10 text

Variables, Data types & Operators •Python IDLE •Don’t need to provide data type •int, float, string & boolean •type() •typecasting •single quoted strings (‘ ’) & double quoted strings (“ ”) are same. •Comments •Operators •String multiplication •String concatenation •String indexing •len() •raw_input()

Slide 11

Slide 11 text

Control flow structures •Terminal setup •No brackets •Indentation concept •Results into beautiful code by default •if, else, elif •Python does not support switch case

Slide 12

Slide 12 text

Loops •while •for •no do-while loops •Nested loops •in keyword with collection •range()

Slide 13

Slide 13 text

Data Structures •tuple - immutable •list - mutable •dictionary •indexing and negative indexing •append to list •index() •string splitting •List addition •Dictionary •keys() •values() •items() •Add new key-value pair in dict •looping in DS

Slide 14

Slide 14 text

User Defined Functions •def •arguments •default arguments •return keyword

Slide 15

Slide 15 text

File Operations •open(fileName, mode) •modes - w, r, a •close()

Slide 16

Slide 16 text

Modules •Python package •built-in modules - math(pow, factorial), web browser(open), os(getcwd). •Create module •Power of Python - 3rd party modules - beautiful soup, requests, flask, django, pyserial •Python package manager - PIP •PIP installation •pip install MODULE_NAME

Slide 17

Slide 17 text

QnA