Unit 1 Python
Unit 1 Python
Unit 1 Python
Unit 1
Python programming cycle is a little bit different from the traditional programming
cycle because, unlike the traditional programming cycle, python DO NOT have
compile or link steps because of this behaviour Python programs run immediately
after changes are made. . The programming Cycle for Python is in rapid prototyping.
In simple terms, the python development cycle do not have compiling and linking
steps, unlike the traditional programming cycle.
Answer to the question , What is programming cycle for Python can be framed as given
below:
Python IDE :
Que 1.2. What is IDE ? Discuss some Python IDE.
Answer
1. IDE is a software package that consists of several tools for developing and
testing the software.
2. An IDE helps the developer by automating the process.
3. IDEs integrate many tools that are designed for SDLC.
4. IDEs were introduced to diminish the coding and typing errors.
5. Some of the Python IDEs are :
a. PyCharm : PyCharm assists the developers to be more productive and
provides smart suggestions. It saves time by taking care of routine tasks,
hence increases productivity.
Features of PyCharm :
i. It has smart code navigation, good code editor, a function for quick
refactoring.
ii. The integrated activities with PyCharm are profiling, testing, debugging,
remote development, and deployments.
iii. PyCharm supports Python web development frameworks, Angular JS,
JavaScript, CSS, HTML and live editing functions.
b. Spyder : Spyder is widely used for data science works. It is mostly used to
create a secure and scientific environment for Python. Spyder Python uses
PyQt (Python plug-in) which a developer can add as an extension.
Features of Spyder :
i. It has good syntax highlighting and auto code completion
features.
ii. Spyder Python explores and edits variables directly from GUI.
iii. It performs very well in multi-language editor.
Interactive mode
Script mode
Interactive Mode
Interactive mode, also known as the REPL provides us with a quick way of
running blocks or a single line of Python code. The code executes via the
Python shell, which comes with Python installation. Interactive mode is
handy when you just want to execute basic Python commands or you are
new to Python programming
To access the Python shell, open the terminal of your operating system and
then type "python". Press the enter key and the Python shell will appear.
This is the same Python executable you use to execute scripts, which
comes installed by default on Mac and Unix-based operating systems.
C:\Windows\sys
tem32>python
(AMD64)] on win32
>>>
The >>> indicates that the Python shell is ready to execute and send your
commands to the Python interpreter. The result is immediately displayed on
the Python shell as soon as the Python interpreter interprets the command.
To run your Python statements, just type them and hit the enter key. You
will get the results immediately, unlike in script mode. For example, to print
the text "Hello World", we can type the following:
The following are the advantages of running your code in interactive mode:
1. Helpful when your script is extremely short and you want immediate
results.
2. Faster as you only have to type a command and then press the enter
key to get the results.
3. Good for beginners who need to understand Python basics.
The following are the disadvantages of running your code in the interactive
mode: