0% found this document useful (0 votes)
10 views

Introduction

Uploaded by

Roopam Seal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Introduction

Uploaded by

Roopam Seal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

PYTHON

E X P LO R I N G D ATA
WHY WRITE PROGRAMS?
• Solving a difficult data analysis problem to having fun to
helping someone else solve a problem.

• A program will figure out what you want to do with newfound


skills.
WHY SHOULD YOU LEARN CODING?

• Coding develops structured & creative thinking.

• Problem solving skills & logic building is heart of programming.

• Learning to write & debug code teaches you persistence.

• It also helps in developing interpersonal skills.

• Coding can be rewarding both financially and personally.


USERS VS PROGRAMMERS
• Users see computers as a set of tools - word processor,
spreadsheet, map, to-do list etc.

• Programmers learn the “computer” ways and the computer


language.

• Programmers have some tools that allow them build new tools.

• Programmers sometimes writes tools for lots of users.

• Programmers write little “helpers” for themselves to automate a


task.
HARDWARE COMPONENTS AT A GLANCE

• CPU : Runs the program , always wondering “what to do next”.


Not the brains exactly - very dumb but very fast.
• Input Devices : Keyboard, Mouse, Touch Screen
• Output Devices : Monitor, Speakers, Printer
• Main Memory : Fast small temporary storage - lost on reboot -
RAM
• Secondary Memory : Slower large memory storage - lasts until
deleted - disk drive /memory stick
PROGRAM FLOW IN A GENERIC COMPUTER
PROGRAM FLOW IN A GENERIC COMPUTER (CONTD.)
PYTHON
WHAT IS PYTHON ?

• Python is a simple, easy to learn, powerful, high level and


object-oriented programming language.

• Python is an interpreted scripting language. Guido Van


Rossum is known as the founder of python programming.
PYTHON INTRODUCTION
• Python is a general purpose, dynamic, high level and interpreted
programming language. It supports Object Oriented programming
approach to develop applications. It is simple and easy to learn and
provides lots of high-level data structures.

• Python is easy to learn yet powerful and versatile scripting language


which makes it attractive for Application Development.

• Python's syntax and dynamic typing with its interpreted nature, makes it
an ideal language for scripting and rapid application development.

• Python supports multiple programming pattern, including object


oriented, imperative and functional or procedural programming
styles.
PYTHON I NTRODUCT I ON ( CONT D…)
• Python is not intended to work on special area such as web
programming. That is why it is known as multipurpose
because it can be used with web, enterprise, 3D CAD etc.

• We don't need to use data types to declare variable because it


is dynamically typed so we can write a=10 to assign an
integer value in an integer variable.

• Python makes the development and debugging fast because


there is no compilation step included in python development
and edit-test-debug cycle is very fast.
T O P I C C OV E R S ( PY T H O N )

• It covers the topics such as–


– Python programming features
– history, versions
– how to install with example
– how to execute
– variables
– keywords
– identifiers
– literals
– operators
– comments
TOPIC COVERS (PYTHON) (CONTD…)
• Python Tuples
– A sequence of immutable objects is known as tuple, it covers
accessing tuple, adding tuple, replicating tuple, updating tuple etc.
• Python Dictionary
– The python dictionary provides details about dictionary operations.
• Python Functions
– It provides a list of python functions with its implementations.
• Python Files I/O
– How to write data into file and read data from file in python?
• Python Modules
– What is python module? What are the usage of modules?
• Python Exceptions
– It explains the errors and exceptions in python.
PYTHON FEAT URES
• Easy to Learn and Use
– Python is easy to learn and use. It is developer-friendly and high level
programming language.
• Expressive Language
– Python language is more expressive means that it is more understandable and
readable.
• Interpreted Language
– Python is an interpreted language i.e. interpreter executes the code line
by line at a time. This makes debugging easy and thus suitable for
beginners.
• Cross-platform Language
– Python can run equally on different platforms such as Windows, Linux, Unix
and Macintosh etc. So, we can say that Python is a portable language.
• Free and Open Source
– Python language is freely available at official web address. The source-code is
also available. Therefore it is open source.
PYTHON FEATURES ( CONT D…)
• Object-Oriented Language
– Python supports object oriented language and concepts of classes
and objects come into existence.
• Extensible
– It implies that other languages such as C/C++ can be used to
compile the code and thus it can be used further in our python
code.
• Large Standard Library
– Python has a large and broad library and provides rich set of
module and functions for rapid application development.
• GUI Programming Support
– Graphical user interfaces can be developed using Python.
• Integrated
– It can be easily integrated with languages like C, C++, JAVA etc.
PYTHON HISTORY
• Python laid its foundation in the late 1980s.

• The implementation of Python was started in the December 1989 by Guido Van Rossum
at CWI in Netherland.

• In February 1991, van Rossum published the code (labeled version 0.9.0) to alt.sources.

• In 1994, Python 1.0 was released with new features like: lambda, map, filter, and
reduce.

• Python 2.0 added new features like: list comprehensions, garbage collection system.

• On December 3, 2008, Python 3.0 (also called "Py3K") was released. It was designed to
rectify fundamental flaw of the language.

• ABC programming language is said to be the predecessor of Python language which was
capable of Exception HCoapniedd-lPirnofg. Maanulidk Bionrstaeniyrafacing with Amoeba
PYTHON VER S I ON
PYTHON VER SI ON ( CON T D…)
P Y T H O N A P P L I C AT I O N A R E A

I. Web Applications
II. Desktop GUI Applications
III. Software Development
IV. Scientific and Numeric
V. Business Applications
VI. Console Based Application
VII.Audio or Video Based Applications
VIII. 3D CAD Applications
IX. Enterprise Applications
X. Applications for Images etc.
SIMPLE DEMO PROGRAM
SIMPLE DEMO PROGRAM (CONTD..)
SIMPLE DEMO PROGRAM (CONTD…)
WRITING A PROGRAM
• Typing commands into the Python interpreter is a great way to
experiment with Python's features, but it is not recommended for
solving more complex problems.

• When we want to write a program, we use a text editor to write the


Python instructions into a file, which is called a script. By
convention, Python scripts have names that end with .py.

• To execute the script, you have to tell the Python interpreter the
name of the file. In a command window, you would type python
filename.py

• Note : “filename” is the name of the file containing python script.


• Before we dive deep into various elements of programming.
• Let’s solve a simple problem to find the most common word in
a text file to get an idea of how python scripts look like.
• Well we missed grammar without which we can’t communicate
in Python.
• So let’s try to communicate again with proper syntax or
“grammar”
THE BUILDING BLOCKS OF PROGRAMS
• Input
– Get data from the "outside world". This might be reading data from a file, or
even some kind of sensor like a microphone or GPS. In our initial programs, our
input will come from the user typing data on the keyboard.
• Output
– Display the results of the program on a screen or store them in a file or perhaps
write them to a device like a speaker to play music or speak text.
• Sequential execution
– Perform statements one after another in the order they are encountered in the
script.
• Conditional execution
– Check for certain conditions and then execute or skip a sequence of statements.
• Repeated execution
– Perform some set of statements repeatedly, usually with some variation.
• Reuse
– Write a set of instructions once and give them a name and then reuse those
instructions as needed throughout your program.

You might also like