0% found this document useful (0 votes)
1 views3 pages

Getting Started With Python Notes

Uploaded by

keshuarora48
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)
1 views3 pages

Getting Started With Python Notes

Uploaded by

keshuarora48
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

Saraswati International School

Abrama Valsad

Class 11 Getting Started with Python


1. Introduction to Python
 Python is a high-level, interpreted programming language developed by Guido van
Rossum in 1991.
 Python is simple, easy to learn, and widely used in different fields.
2. Features of Python
 Simple and easy syntax
 Interpreted language
 Portable and platform independent
 Open-source
 Object-oriented programming support
 Large standard library
3. Applications of Python
 Web Development
 Artificial Intelligence
 Machine Learning
 Data Analysis
 Scientific Applications
 Game Development
4. Python Working Modes
 Interactive Mode: Executes one command at a time and gives immediate output.
 Script Mode: Programs are written in files with .py extension.
5. Python IDE
 IDE stands for Integrated Development Environment.
 IDLE is Python’s default IDE.
 Other IDEs include PyCharm, VS Code, Spyder, and Jupyter Notebook.
6. Tokens in Python
 Tokens are the smallest units of a Python program.
 Types of Tokens: Keywords, Identifiers, Literals, Operators, and Punctuators.
7. Keywords
 Keywords are reserved words with special meaning in Python.
 Examples: if, else, while, for, break, continue, True, False.
8. Identifiers
 Identifiers are names given to variables, functions, and objects.
 Rules for Identifiers:
 • Must begin with a letter or underscore.
 • Cannot start with a digit.
 • Cannot contain spaces.
 • Keywords cannot be used as identifiers.
9. Python Pluses (Advantages)
 Easy to learn and understand
 Simple syntax similar to English
 Free and open-source
 Portable across operating systems
 Useful in AI, web development, and data science

1
Saraswati International School
Abrama Valsad
 Large collection of libraries
10. Python Minuses (Disadvantages)
 Slower execution compared to compiled languages
 Uses more memory
 Not suitable for mobile app development
 Runtime errors may occur due to dynamic typing
11. Important Definitions
 Interpreter: Converts program line by line into machine language.
 Compiler: Converts complete program at once.
 Token: Smallest unit of a program.
 IDE: Software used to write and execute programs.
12. Quick Revision
 Python is an interpreted language.
 Python files use .py extension.
 IDLE is Python’s default IDE.
 Keywords are reserved words.
 Python is portable and open-source.
13. Important Exam Questions
 What is Python?
 Explain features of Python.
 Differentiate Interactive Mode and Script Mode.
 What are tokens?
 Define identifiers with rules.
 Explain advantages and disadvantages of Python.
 What is IDE?
 Explain keywords in Python.
Examples For reference:
1. print() Function
The print() function is used to display output on the screen.
Syntax: print("message")
Example Program
print("Hello World")
print("Welcome to Python")
Output
Hello World
Welcome to Python

2. Comments in Python
Comments are notes written inside programs for better understanding.
Python ignores comments during execution.

(A) Single Line Comment


Single line comments start with #.
Example
# This is a single line comment
print("Python")

2
Saraswati International School
Abrama Valsad

Output
Python

(B) Multi-line Comment


Multi-line comments are written using triple quotes.
Example
"""
This is a
multi-line comment
"""
print("Computer Science")
Output
Computer Science

3. input() Function
The input() function is used to take input from the user.
Syntax
input("message")

Example Program
name = input("Enter your name: ")
print("Hello", name)
Sample Output
Enter your name: Riya
Hello Riya

4. Program to Add Two Numbers


Program
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
sum = a + b
print("Sum =", sum)
Sample Output
Enter first number: 10
Enter second number: 20
Sum = 30

Quick Revision
 print() → Displays output
 input() → Takes input from user
 # → Single line comment
 """ """ → Multi-line comment
 int() → Converts value into integer

You might also like