Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
164 views

Programming Using Python: Amey Karkare Dept. of CSE IIT Kanpur

The document discusses programming in Python. It describes the programming cycle as writing or editing a program, running it with inputs, debugging if needed, and repeating for other inputs. It recommends using Spyder, an integrated development environment for Python that includes an editor, Python shell, and debugger. Spyder allows running and testing programs interactively in the shell.

Uploaded by

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

Programming Using Python: Amey Karkare Dept. of CSE IIT Kanpur

The document discusses programming in Python. It describes the programming cycle as writing or editing a program, running it with inputs, debugging if needed, and repeating for other inputs. It recommends using Spyder, an integrated development environment for Python that includes an editor, Python shell, and debugger. Spyder allows running and testing programs interactively in the shell.

Uploaded by

Suryansh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Programming using Python

Amey Karkare
Dept. of CSE
IIT Kanpur

For any queries reach out to rahulgr@iitk.ac.in or rahulgarg@robustresults.com


or whatsapp 9910043510

1
Python Programming E&ICT IIT Kanpur
The Programming Cycle for Python

2
Programming E&ICT IIT Kanpur
Run
with some input

Write/Edit
OK?
NO
YES
YES
More
Inputs?
NO
3
Programming E&ICT IIT Kanpur
The Programming Cycle for Python
1. Write your program or edit (i.e., change
or modify) your program.
2. Run your program on an input.
– Python is an interpreted language (unlike C,
C++, Java). There is no separate compilation
step.
3. If output is not correct, return to editing
step.
4. Repeat step 2,3 for other inputs, if any.
4
Programming E&ICT IIT Kanpur
An IDE for Python
• In this course, we recommend that you use
Spyder: an Integrated Development
Environment (IDE) for Python.
• Spyder consists of
– Python shell (iPython)
– Editor
– Debugger (Object Inspector)

5
Programming E&ICT IIT Kanpur
Toolbar
Debugger/
Inspector

Editor

iPython Shell

Spyder: Python IDE 6


Programming E&ICT IIT Kanpur
User Program
Filename, preferred extension is py
7
Programming E&ICT IIT Kanpur
Running the Program
8
Programming E&ICT IIT Kanpur
Output in the shell

iPython Shell & Output


9
Programming E&ICT IIT Kanpur
iPython Shell & Output
10
Programming E&ICT IIT Kanpur
IN[1]:
Welcome
to Python 3
IN[2]:

IN[3]:

IN[4]: ( )

Python Shell is Interactive


11
Programming E&ICT IIT Kanpur
IN[1]: Python Shell Prompt
Welcome
to Python 3
IN[2]:
User Commands
IN[3]: (Statements)

IN[4]: ( )

Outputs

Python Shell is Interactive


12
Programming E&ICT IIT Kanpur

You might also like