0% found this document useful (0 votes)
10 views19 pages

Python Basics for Class 11 Students

This document provides an introduction to Python programming, highlighting its advantages such as ease of use, expressiveness, and cross-platform capabilities, as well as its disadvantages including slower execution speed and fewer libraries compared to other languages. It also covers the installation and usage of Python IDLE and Anaconda, along with the differences between interactive and script modes. Additionally, it includes a basic example of a Python print statement to demonstrate output functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views19 pages

Python Basics for Class 11 Students

This document provides an introduction to Python programming, highlighting its advantages such as ease of use, expressiveness, and cross-platform capabilities, as well as its disadvantages including slower execution speed and fewer libraries compared to other languages. It also covers the installation and usage of Python IDLE and Anaconda, along with the differences between interactive and script modes. Additionally, it includes a basic example of a Python print statement to demonstrate output functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CLASS 11

COMPUTER SCIENCE WITH PYTHON

02
GETTING STARTED WITH PYTHON
02:
GETTING STARTED WITH PYTHON

In This Chapter

▪ Introduction
▪ Python-Pluses
▪ Python-Some minuses
▪ Working in Python
▪ Understanding First Program/Script
Python Introduction
Computer programming is the process of writing, testing, troubleshooting,
debugging and maintaining of a computer program.
Python is a general purpose, interpreted, interactive, object oriented and
high-level programming language.
It was developed by Guido van Rossum in 1991
Python is based on or influenced with two programming :

• ABC language
• Modula-3
Python Pluses

1. Easy to use – Easy to use Object Oriented language with very


simple syntax.
2. Expressive Language - It is more understandable and readable.
3. Interpreted language –Code execution & interpretation line by line
4. Its Completeness - Support wide rage of library
5. Cross-platform language –It can run on windows, linux,
Macintosh etc. Python is a portable language.
6. Free & Open Source – Can be downloaded freely and source code
is available
7. Variety of usage/Applications –
• Scripting
• Web Applications
• Game development
• System Administrations
• Rapid Prototyping
• GUI Programs
• Database Applications
8. Extensible -It can be extended to other languages like C/C++.

9. Integrated- It can be easily integrated with languages like C, C++,


JAVA etc.
Python-Minus(Disadvantages)

1. Not the fastest language- Python executes with the help of an


interpreter instead of the compiler, which causes it to slow down . Python
code is executed line by line

2. Lesser library than C and Java

3. Not strong on Type-binding – Python interpreter is not very strong on


catching ‘Type-mismatch’ issues.

4. Not easily convertible – It comes to translating a program into another


programming language.
Interpretation VS Compilation
Interpreter Compiler
Interpreter takes a source program and runs it A compiler is a program which coverts the
line by line, translating each line as it comes to entire source code of a programming language
it. into executable machine code for a CPU.

Interpreter takes less amount of time to Compiler takes large amount of time to
analyze the source code, but the overall analyze the entire source code, but the overall
execution time of the program is slower. execution time of the program is
comparatively faster.
Its Debugging is easier as it continues Compiler generates the error message only
translating the program until the error is met after scanning the whole program
Examples : Python Interpreter(Eg: IDLE etc, Examples: C, C++
Perl
Java(Does both compilation and interpretation)
[Link]
Working in Python

Installation of Python IDLE


[Link]

Python – IDLE

IDLE (Integrated Development and Learning Environment) is an


integrated development environment (IDE) for Python. The Python
installer for Windows contains the IDLE module by default.
How to work in Python
The two different modes in python:
1. Interactive mode
Interactive mode is used when an user wants to run one single line
or one block of code. It runs very quickly and gives the output
instantly.
2. Script mode
Scrip mode is used when the user is working with more than one
single code or a block of code. It takes more time to compile.

1. File>Open OR File>New Window (for creating a new script file)


2. Write the Python code in script mode
3. Save it (CTRL+S)
4. Execute it in interactive mode- by using Run->Run Module option or
F5.
Working with Anaconda distribution

Anaconda is a free and open-source distribution of the Python and R


programming languages for scientific computing, that aims to simplify
package management and deployment. The distribution includes data-
science packages suitable for Windows, Linux, and macOS.

Steps to install anaconda


[Link]
Anaconda-on-Windows/
Anaconda distributor provides the following tools to work in Python
Jupyter notebook: It is web based, interactive computing environment
Spyder: It is a powerful Python IDLE with many useful editing,
interactive testing and debugging features.

Working in Jupyter
[Link]
[Link]
[Link]
Working in Spyder IDE

It is a powerful Python IDLE with many useful editing,


interactive testing and debugging features.
[Link]

PyScripter IDE- another Popular IDE


Free and open source IDE. It is used for writing and executing Python
programs.
[Link]
Understanding First Program/Script
Understanding print( )
To print or display the output
print(<object to be printed>….)
Eg:
Statement Output
print(“HelloWorld”) HelloWorld

print(“My name is Rohan”) My name is Rohan

print(“12345”) 12345
Print(“Class 11:Computer Science”) Class 11:Computer Science
THANK YOU

You might also like