Python is an interpreted, high-level, object-oriented programming language with dynamic semantics. It was created by Guido van Rossum and first released in 1991. Python is known for its simple, easy-to-read syntax, which emphasizes readability and reduces the cost of program maintenance. It supports modules and packages, which encourages program modularity and code reuse.
Python is widely used in various domains, including:
- Web development (both frontend and backend).
- Data science and data analysis.
- Machine learning and artificial intelligence.
- Automation and scripting.
- Software development and testing. Its extensive standard library and the presence of third-party libraries make it versatile and powerful for many types of software development projects.
Download the latest version of Python from the official Python website.
Install Python
- Windows: Double-click the downloaded installer and follow the prompts.
- macOS: Follow the instructions in the installer package.
- Linux: Use your distribution's package manager (e.g.,
apt-get,yum).
Open a terminal or command prompt and type:
python --version
On successful completion of the course, students will be able to:
- Develop, document, and debug modular python programs to solve computational problems.
- Select a suitable programming construct and data structure for a situation.
- Use built-in strings, lists, sets, tuples and dictionary in applications.
- Define classes and use them in applications.
- Use files for I/O operations.
-
Unit 1 Introduction to Programming using Python: Structure of a Python Program, Functions, Interpreter shell, Indentation. Identifiers and keywords, Literals, Strings, Basic operators (Arithmetic operator, Relational operator, Logical or Boolean operator, Assignment Operator, Bit wise operator).
-
Unit 2 Building blocks of Python: Standard libraries in Python, notion of class, object and method.
-
Unit 3 Creating Python Programs: Input and Output Statements, Control statements:-branching, looping, Exit function, break, continue and pass, mutable and immutable structures. Testing and debugging a program
-
Unit 4 Built-in data structures: Strings, lists, Sets, Tuples and Dictionary and associated operations. Basic searching and sorting methods using iteration and recursion.
-
Unit 5 Visualization using 2D and 3D graphics: Visualization using graphical objects like Point, Line, Histogram, Sine and Cosine Curve, 3D objects
-
Unit 6 Exception Handling and File Handling: Reading and writing text and structured files, Errors and Exceptions.
Django is a high-level Python web framework that promotes rapid development and clean, pragmatic design. It is designed to help developers take applications from concept to completion as quickly as possible, emphasizing reusability, and following the "don't repeat yourself" (DRY) principle.
Key features of Django include:
- ORM (Object-Relational Mapping): Provides a way to interact with databases using Python code instead of SQL.
- Admin Interface: Automatically generated admin interface for managing data models.
- Security: Built-in protection against common security threats such as SQL injection, cross-site scripting, and cross-site request forgery.
- Scalability: Designed to scale well with high traffic demands.
- Template Engine: Allows for creating dynamic HTML templates.
- URL Routing: Maps URLs to views using a simple syntax. Django is widely used in web development for its simplicity, powerful features, and ability to handle complex applications with ease.
Installation basic commands for installation:
- pip install django
- Create Environment file : install virtualenv : pip install virtualenv and activate it OR pip install pipenv pipenv install django