Programming Using Python: Amey Karkare Dept. of CSE IIT Kanpur
Programming Using Python: Amey Karkare Dept. of CSE IIT Kanpur
Amey Karkare
Dept. of CSE
IIT Kanpur
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
IN[3]:
IN[4]: ( )
IN[4]: ( )
Outputs