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

Padhaaii: Chapter-1 Introdution To Python

Python is a general-purpose, object-oriented programming language that is high-level, portable, scalable, and easy to use. It was created in the late 1980s by Guido van Rossum at CWI in the Netherlands. Python can be run in interactive mode via a command line interpreter for testing small pieces of code, or in script mode by storing code in a file with a .py extension and running it with an interpreter. Common Python interpreters include PyCharm, IDLE, and Sublime Text.

Uploaded by

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

Padhaaii: Chapter-1 Introdution To Python

Python is a general-purpose, object-oriented programming language that is high-level, portable, scalable, and easy to use. It was created in the late 1980s by Guido van Rossum at CWI in the Netherlands. Python can be run in interactive mode via a command line interpreter for testing small pieces of code, or in script mode by storing code in a file with a .py extension and running it with an interpreter. Common Python interpreters include PyCharm, IDLE, and Sublime Text.

Uploaded by

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

CHAPTER-1

INTRODUTION TO PYTHON
1.1 Introduction:
 General-purpose Object Oriented Programming language.
 High-level language
 Developed in late 1980 by Guido van Rossum at National Research Institute for
Mathematics and Computer Science in the Netherlands.
 It is derived from programming languages such as ABC, Modula 3, small talk, Algol-
68.
 It is Open Source Scripting language.

ii
 It is Case-sensitive language (Difference between uppercase and lowercase letters).
 One of the official languages at Google.

aa
1.2 Characteristics of Python:
 Interpreted: Python source code is compiled to byte code as a .pyc file, and this byte
code can be interpreted by the interpreter.
 Interactive
 Object Oriented Programming Language
dh
 Easy & Simple
 Portable
 Scalable: Provides improved structure for supporting large programs.
 Integrated
 Expressive Language
pa

1.3 Python Interpreter:


Names of some Python interpreters are:
 PyCharm
 Python IDLE
 The Python Bundle
 pyGUI
 Sublime Text etc.

There are two modes to use the python interpreter:


i. Interactive Mode
ii. Script Mode

https://padhaaii.wordpress.com/ Page 2
i. Interactive Mode: Without passing python script file to the interpreter, directly
execute code to Python (Command line).

Example:
>>>6+3

Output: 9

ii
aa Fig: Interactive Mode
dh
Note: >>> is a command the python interpreter uses to indicate that it is ready. The
interactive mode is better when a programmer deals with small pieces of code.
To run a python file on command line:
exec(open(“C:\Python33\python programs\program1.py”).read( ))

ii. Script Mode: In this mode source code is stored in a file with the .py extension
pa

and use the interpreter to execute the contents of the file. To execute the script by the
interpreter, you have to tell the interpreter the name of the file.

Example:
if you have a file name Demo.py , to run the script you have to follow the following
steps:

Step-1: Open the text editor i.e. Notepad


Step-2: Write the python code and save the file with .py file extension. (Default
directory is C:\Python33/Demo.py)
Step-3: Open IDLE ( Python GUI) python shell
Step-4: Click on file menu and select the open option
Step-5: Select the existing python file
Step-6: Now a window of python file will be opened
Step-7: Click on Run menu and the option Run Module.
https://padhaaii.wordpress.com/ Page 3
Step-8: Output will be displayed on python shell window.

ii
aa Fig. : IDLE (Python GUI)
dh
pa

Fig: Python Shell

https://padhaaii.wordpress.com/ Page 4

You might also like