Tuesday, 31 January 2023

A Beginner's Guide to Python List Operations and Methods.

 


A Beginner's Guide to Python List Operations and Methods

Python is a powerful and versatile programming language that is widely used for data analysis, machine learning, and web development. One of the key features of Python is its built-in data structures, including lists, which are ordered collections of elements. In this beginner's guide, we'll explore the basics of Python lists, including operations and methods that can be used to manipulate them.

CREATING A PYTHON LIST

The first step to working with lists in Python is creating them. Lists are created using square brackets [] and elements are separated by commas. For example, you can create a list of numbers like this:

numbers = [1, 2, 3, 4, 5]

You can also create a list of strings:

words = ['apple', 'banana', 'cherry']

And a list of mixed data types:

mixed = [1, 'apple', 2.0, False]

ACCESSING ELEMENTS IN A PYTHON LIST

Once you have created a list, you can access its elements using their index number. The index numbers start from 0 and go up to the length of the list minus 1. For example, to access the first element of the numbers list, you would write:

print(numbers[0])

This would output 1.

You can also access elements from the end of the list by using negative index numbers. For example, to access the last element of the numbers list, you would write:

print(numbers[-1])

This would output 5.

MODIFYING ELEMENTS IN A PYTHON LIST

You can modify elements in a list by assigning new values to their index numbers. For example, to change the second element of the numbers list, you would write:

numbers[1] = 20

Now, the second element of the numbers list is 20.

ADDING ELEMENTS TO A PYTHON LIST

There are several methods for adding elements to a Python list. One of the most common is the append() method, which adds a new element to the end of the list. For example, to add a new number to the end of the numbers list, you would write:

numbers.append(6)

Now, the numbers list is [1, 20, 3, 4, 5, 6].

You can also use the extend() method to add multiple elements to the end of a list. For example, to add two more numbers to the numbers list, you would write:

numbers.extend([7, 8])

Now, the numbers list is [1, 20, 3, 4, 5, 6, 7, 8].

REMOVING ELEMENTS FROM A PYTHON LIST

There are several methods for removing elements from a Python list. One of the most common is the remove() method, which removes the first occurrence of an element from the list. For example, to remove the number 20 from the numbers list, you would write:

numbers.remove(20)

Now, the numbers list is [1, 3, 4, 5, 6, 7, 8].

You can also use the pop() method to remove an element from the end of the list. For example, to remove the last element from the numbers list, you would write:

numbers.pop()

Now, the numbers list is [1, 3, 4, 5, 6, 7].

SORTING A PYTHON LIST

You can sort a Python list using the sort() method. For example, to sort the numbers list in ascending.

10 Must-Know Advanced SQL Techniques for Boosting Your Database Performance


10 Must-Know Advanced SQL Techniques for Boosting Your Database Performance


SQL is a powerful database language that is used to manage, manipulate and retrieve data from relational databases. Here are some of the key aspects of SQL that you need to know to become proficient:


SQL commands: The most commonly used SQL commands are SELECT, INSERT, UPDATE, DELETE, CREATE and ALTER. Understanding these commands is the foundation of SQL.


Data Types: SQL supports several data types including character strings, numbers, and dates. It’s important to understand these data types and choose the right one when creating a database.


Database Structures: There are two main database structures in SQL, the relational database and the non-relational database. The relational database is structured as tables with rows and columns, while the non-relational database is structured as a collection of documents.


Data Filtering: You can use SQL to filter data based on specific conditions. This is useful when you want to retrieve specific data from a large database.


Joining Tables: Joining tables allows you to combine data from two or more tables into one result set. This is a powerful feature of SQL and is used for complex data analysis.


Indexing: Indexing is a technique used to speed up data retrieval in SQL databases. It works by creating a map of the data in the database, making it faster to retrieve the data.


Stored Procedures: A stored procedure is a pre-compiled set of SQL statements that can be executed as a single unit. Stored procedures are useful for encapsulating complex business logic and improving database performance.


Transactions: Transactions allow you to perform multiple database operations as a single unit of work. If any of the operations fail, the entire transaction is rolled back, ensuring the integrity of the data in the database.


Security: SQL provides several security features to protect your data, including user authentication, access control and data encryption.


SQL is an essential tool for managing data in modern organizations. Whether you're a data analyst, database administrator or software developer, having a good understanding of SQL is essential for success

Monday, 30 January 2023

Python Strings: The Basics of Text Manipulation in Python

Python is one of the most popular programming languages in the world, and for good reason. With its simple and straightforward syntax, it is a great choice for beginners and experts alike. One of the key features of Python is its ability to handle strings, which are sequences of characters. In this blog post, we will explore the basics of python strings, how to manipulate them, and why they are so important in programming.

What are Python Strings?

Python strings are sequences of characters. They are enclosed in either single or double quotes, and can be of any length. For example, the following are valid python strings:

"Hello World"

'Hello World'

"This is a long string"

'This is a long string'

Python strings are immutable, which means that once a string is created, it cannot be changed. However, you can create new strings by concatenating or slicing existing strings.


Manipulating Python Strings

One of the most important aspects of strings in Python is the ability to manipulate them. This can be done in many ways, including concatenation, slicing, and replacing characters.

Concatenation

Concatenation is the process of combining two or more strings into a single string. This is done using the plus (+) operator. For example:

string1 = "Hello" string2 = "World" string3 = string1 + string2

print(string3)

Output: HelloWorld

Slicing

Slicing is the process of selecting a portion of a string. This can be done using square brackets []. For example:

string = "Hello World"

print(string[0:5])

Output: Hello

Replacing Characters

Replacing characters in a string can be done using the replace() method. For example:

string = "Hello World"

string = string.replace("o", "x")

print(string)

Output: Hellx Wxrld

Why are Python Strings Important?

Python strings are important because they are used in almost every aspect of programming. They are used to store data, display messages to the user, and even process input. Python strings are also commonly used in web development to store data that is passed between the client and server. Additionally, strings are used in many algorithms and data structures, such as strings sorting, searching, and more.

In conclusion, Python strings are a fundamental aspect of programming and are essential for any programmer to know. With their ability to store, manipulate, and process data, they are an important tool in any programmer's toolkit. Whether you are a beginner or an expert, mastering the basics of Python strings is a must for anyone who wants to be successful in programming.

.

Sunday, 29 January 2023

Python for Beginners: A Comprehensive Guide to Get Started"

Python is a popular, high-level programming language known for its simplicity and versatility. Whether you're a beginner looking to get into programming or an experienced developer wanting to learn a new language, Python is an excellent choice. In this guide, we'll walk you through the basics of Python programming and help you get started with your first projects. Body: Understanding the Basics: Start by learning the fundamentals of Python, including syntax, data types, and variables. Get a basic understanding of how to write and run Python code. Data Structures: Explore the different data structures in Python, such as lists, dictionaries, and sets. Learn how to store and manipulate data efficiently. Control Flow: Study the control flow statements in Python, including if/else, loops, and functions. Master how to control the flow of your code and make decisions based on data. Modules and Packages: Discover how to import and use pre-existing modules and packages in your Python code. Learn how to extend the functionality of your code by leveraging existing tools and libraries. File I/O: Learn how to read and write files in Python, including CSV and JSON. Get hands-on experience working with real-world data and learn how to manipulate it with Python. Object-Oriented Programming: Study the principles of object-oriented programming (OOP) in Python. Learn how to define classes and create objects, and discover the benefits of using OOP in your Python code. Projects and Next Steps: Finally, put your newfound knowledge into practice by completing a beginner-friendly project. Get inspiration and ideas for future projects, and continue your journey as a Python programmer. Conclusion: Python is an easy-to-learn and powerful programming language that is perfect for beginners. With its simple syntax, versatile libraries, and active community, Python is a great choice for anyone looking to get into programming. Whether you're looking to automate tasks, build web applications, or dive into data science and machine learning, Python is the perfect place to start. So why wait? Get started with Python today and take your first steps in coding! Include relevant keywords in the post, such as "Python", "programming language", "beginners", "guide", "getting started", "data structures", "control flow", "file I/O", "OOP", "projects", etc. to improve the search engine optimization

Python interview questions .

PYTHON interview QUESTIONS 

 

Python is among the most popular programming language today. Major organizations in the world build programs and applications using this object-oriented language. Here, you will come across some of the most frequently asked questions in Python job interviews in various fields. Our Python interview questions for experienced and freshers will help you in your interview preparation. Let us take a look at some of the most popular and significant Python programming interview questions and answers:

 

CHAPTER-1

 

REVIEW OF CLASS-XI

 

Questions based on python topics of CLASS-XI

 

: 1. What is case sensitivity of a language?

 

2. Write name of modes which are used by python interpreter.

 

3. Find valid identifier among the following:

 

(i) and

(ii) for US

iii) simple-interest

.

4. Write the type/name of token for the following:

 

that math module

 

i) 83.95 == (1

 

5. Which of the following operator has right to left associativity in python:

 

(1)% (H) and

 

(iv) >=

 

6. How many times the following loop will execute: for L in range(7,29,4):

 

if L%5==0: break

 

else:

 

print(L)

 

7. A string is declared as: S = "HELLO PROGRAMMER"

 

What will be the output of S.find("GRAM", 2, 15) 8. Given the list L-[25,8,61,80,54,17,11,99]

 

Write the output of print(L[-2:-7: -3]) 9. Write output for the following python code:

 

>>>K [5,7,8, [10,4), 11,2]

 

>>>print(len(K))

 

10. Write the output of the following python statements (Assume

 

already imported):

 

math.floor(-44.6) math.fabs(-67.8)

 

Saturday, 28 January 2023

Python standard for database interfaces is the pythim DB-API | mr indian coder |

Python can be used to access and manipulate databases in a variety of ways.
The most popular way is through an object-relational mapping (ORM) library, such as SQLAlchemy. SQLAlchemy provides a way to map Python classes to database tables, and instances of those classes (objects) to rows in the database. It also provides a rich set of tools for querying and manipulating the data.

Another popular way to interact with a database is through Python's built-in module, sqlite3. This module provides an interface for creating and interacting with SQLite databases. It allows you to execute SQL commands directly from your Python code and provides a convenient way to create and query databases.

Finally, you can use the Python Database API (DB-API) to connect to and interact with a wide variety of databases. This API provides a consistent set of functions for working with databases, making it easier to write code that works with multiple databases.

 

INTERFACE OF PYTHON WITH AN SQL DATABASE

 

Python's standard for database interfaces is the Python DB-API.

 

Python Database API supports a wide range of database servers such as Gadfly, mSQL, MySQL, Oracle, Sybase,etc.

 

You need to download separate DB-API module for each database you need to access ➤ DB-API provides a minimal standard for working with databases.

 

> MySQLdb is an interface for connecting to a MySQL database servers from Python.

> Connect method of MySQLdb interface is used to create a connection object using MySQL.db module. A cursor is a Python object that enables you to work with the database. It facilitates the row by row processing of records. In database terms, the cursor is positioned at a particular location within a table or tables in a database. cursor you need to call the cursor method on the database object

 

To get a > next line

 

execute() is used to execute a sql query,

syntax <cursor object>execute(sql query string)

To extract records from the resultset of a query following functions are used:

 

fetch all() returns all the records from the query resultset as atuple.

>fetchone() returns one record from the query result set fetchmany(n) returns 'n' records from the query resultset.

 

>rowcount() returns the number of records retreived from the cursor To save your changes to the database, you must commit the transaction using commit()

 

> When you are done with the script, close the cursor using <cursor>.close() and then the connection to free up the resources.

 

The DB-APT's include a defined set of exceptions.

 

 

Tags :-

 

Interface of python with an sql database

Interface of python with an sql database class 12 notes    

Interface of python with an sql database class 12    

Can you use sql with python    

Why use python with sql server    

 

Friday, 27 January 2023

INTERFACE OF PYTHON WITH AN SQL DATABASE

Python can be used to access and manipulate databases in a variety of ways.
The most popular way is through an object-relational mapping (ORM) library, such as SQLAlchemy. SQLAlchemy provides a way to map Python classes to database tables, and instances of those classes (objects) to rows in the database. It also provides a rich set of tools for querying and manipulating the data.

Another popular way to interact with a database is through Python's built-in module, sqlite3. This module provides an interface for creating and interacting with SQLite databases. It allows you to execute SQL commands directly from your Python code and provides a convenient way to create and query databases.

Finally, you can use the Python Database API (DB-API) to connect to and interact with a wide variety of databases. This API provides a consistent set of functions for working with databases, making it easier to write code that works with multiple databases.

 

INTERFACE OF PYTHON WITH AN SQL DATABASE

 

Python's standard for database interfaces is the Python DB-API.

 

Python Database API supports a wide range of database servers such as Gadfly, mSQL, MySQL, Oracle, Sybase,etc.

 

You need to download separate DB-API module for each database you need to access ➤ DB-API provides a minimal standard for working with databases.

 

> MySQLdb is an interface for connecting to a MySQL database servers from Python.

> Connect method of MySQLdb interface is used to create a connection object using MySQL.db module. A cursor is a Python object that enables you to work with the database. It facilitates the row by row processing of records. In database terms, the cursor is positioned at a particular location within a table or tables in a database. cursor you need to call the cursor method on the database object

 

To get a > next line

 

execute() is used to execute a sql query,

syntax <cursor object>execute(sql query string)

To extract records from the resultset of a query following functions are used:

 

fetch all() returns all the records from the query resultset as atuple.

>fetchone() returns one record from the query result set fetchmany(n) returns 'n' records from the query resultset.

 

>rowcount() returns the number of records retreived from the cursor To save your changes to the database, you must commit the transaction using commit()

 

> When you are done with the script, close the cursor using <cursor>.close() and then the connection to free up the resources.

 

The DB-APT's include a defined set of exceptions.

 

 

Tags :-

 

Interface of python with an sql database

Interface of python with an sql database class 12 notes    

Interface of python with an sql database class 12    

Can you use sql with python    

Why use python with sql server    

 

Thursday, 26 January 2023

Structured query language | SQL | mr indian coder |

Structured Query Language (SQL) is a standardized programming language that is used to manage relational databases and perform various operations on the data in them.

 

STRUCTURED QUERY LANGUAGE (SQL)

 

SQL: It is a simple query language used for accessing, handling and managing data in relational databases. Purpose behind learning

 

 

 

SQL: When a user wants to get some information from a database file, it can issue a query. A query is a user request to retrieve data or information with a certain condition. SQL is a query language that allows user to specify the conditions, (instead of algorithms), 

 

 

 

Types of SQL commands

 

 

Data Definition Language Command (DDL Command): All the commands used to create, modify or delete physical structure of an object like table.

e.g. Create, Alter, Drop.

 

• Data Manipulation Language Command (DML. Command): All the commands used to modify contents of a table come under this category.

 

eg, insert, Delete, Update commands. 

 

 

 

• Transaction Control Language Command (TCL Command): These commands are used to control transaction of DML commands.

e.g. Commit, Rollback.

Each field in a SQL database is assigned a data type.

SQL supports following data types.

char(n) - fixed width n character string, varchar(n)- variable width string, int-numbers without decimal.

float-numbers with decimal in base 10 exponential. date- stores date type values.

 

 

Basic structure of an SQL query:

 

• General structure-SELECT ALL/DISTINCT, AS, FROM, WHERE

 

 

Comparison- IN, BETWEEN, Grouping-GROUP BY HAVING, COUNT(), SUM(), AVG(), MAX(), MIN()

 

 

Display order- ORDER BY, ASC/DESC Logical operators- AND, OR, NOT

 

 

Types of Constraints:

Constraint is a condition applicable on a field or group of fields.

 

 

 

⚫Column constraint: Apply only to individual column.

 

 

⚫ Table constraint: Apply to group of columns.

 

7

 

 

ORDER BY Clause: The resulting column can be sorted in ascending and descending order using the ORDER BY clause.

 

 

 

Syntax:

 

 

 

SELECT column-name>[<column-name>1 FROM <table-name>

 

 

 

WHERE conditions ORDER BY <column-name>; > Conditions based on a range: SQL provides a BETWEEN operator that defines a range of values that the column

 

 

 

value must fall for the condition to become true.

 

 

 

Syntax:

 

SELECT <column-name> FROM<table-name>WHERE <column-name> BETWEEN <value>AND<value>; Conditions based on a list: To specify a list of values, IN operator is used.

 

 

 

Tags: -

Mr indian coder

mr indian coder

Structured query language (sql)    

Structured query language pdf    

Structured query language examples    

Structured query language class 11 notes    

Structured query language class 12 notes    

Structured query language in hindi    

Structured query language download    

Structured query language is used to    

Structured query language mStructured query language in dbms

structured query language in dbms:

Structured query language (sql)    

Structured query language examples    

Structured query language in hindi        

Structured query language meaning in telugu    

Structured query language enables data analyst to    

Structured query language meaning in hindeaning in hindi

Database Management | mr indian coder

 

A database management system (DBMS) is system software for creating and managing databases, allowing end users to create, protect, read, update and delete data in a database.

 

DATABASE MANAGEMENT

A Database consists of a number of tables. >The database oriented approach supports multiple views of the same data.

 

In database oriented approach, we store the common data in one table and access it from the required tables Multiple views of the same database may exist for different users

 

The logical level of abstraction defines the type of data that is stored in the database and the relationship between them. The design of the database is known as the database scheme.

 

The database administrator has the total control of the database and is responsible for setting up and maintaining the database. A data model is the methodology used by a particular DBMS to organize and access the data.

 

> Hierarchical, Network and Relational model are the three popular data models. Hierarchical Model:

(a) The hierarchical model was developed by IBM in 1968. (b) The data is organized in a tree structure where the nodes represent the records and the branches of the tree represent the

 

(c) Since the data is organized in a tree structure, the parent node has the links to its child nodes.

 

(d) If we want to search a record, we have to traverse the tree from the root through all its parent nodes to reach the specific record.

 

(e) The hashing function is used to locate the root (0) SYSTEM2000 is an example of hierarchical database.

 

Network Model:

(a) Recording of relationship in the network model is implemented by using pointers.

(b) Recording of relationship implementation is very complex since pointers are used.

 

(c) DBTG Codasyl was the first network database.

 

Relational Model:

(a) The Relational model, organizes data in the form of independent tables (consisting of rows and columns) that are related to each other

 

(b) A table consists of a number of rows (records/tuples) and columns (attributes).

 

(c) The degree of the table denotes the number of columns

(d) A domain in the relational model is said to be atomic, if it consists of indivisible units.

 

(e) A super key is a type of attribute that collectively identifies an entity in an entire set.

 

(f) A primary key is a set of one or more attributes that can uniquely identify the relationship keys relationship among data .

 

 

 

 

 

 

 

Tags:-

 

Database management system in english playlist  

Database management system in hindi playlist study extent class 10    

Database management interview questions and answers  

Database management system gate academy    

Database management system book    

Database management application class 12 cbse book    

Database management system textbook    

Database management    

Data management    

Data management body of knowledge    

Data management books    

Relational database manDatabase management system

Database management system quantum pdf    

Database management system notes    

Database management system examples    

Database management system definition    

Database management system project file pdf    

Database management system disadvantages    

 Database management system wikipedia    

Database management softwareagement system system full course 

Wednesday, 25 January 2023

Computer Network | mr indian coder |

Computer Network tutorial provides basic and advanced concepts of Data Communication & Networks (DCN). Our Computer Networking Tutorial is designed for beginners and professionals.

 

Our Computer Network tutorial includes all topics of Computer Network such as introduction, features, types of computer network, architecture, hardware, software, internet, intranet, website, LAN, WAN, etc

COMPUTER NETWORK

 

Evolution of Networking: 

(a) ARPANET: In 1969, US govt. formed an agency named ARPANET (Advanced Research Projects Agency Network) to connect computers at various universities and defense agencies.

 

 (b) Internet (INTER-connection NETwork): The Internet is a worldwide network of computer networks.

 

 Switching Techniques: are used to transmit data across networks.

 

(a) Circuit switching complete the data are transmitted.

 

physical connection between two computers is established and then repeated until the link send data to another switching office which again does the same. the process is message reaches the destination.

 

 

 

(b) Message Switching: here the source sends data or message into the switching office which looks for a free

 

(c) Packet Switching: similar to message switching except that there is strict upper limit to the packet size

 

Data communication Terminologies the data.

 

(a) Channel: it is medium that carries Transmission Media of a transmission channel.

 

(b) Band: It is a measure of the data carrying capacity of a channel.

 (c) Band width it is the difference between the highest and lowest frequencies

 

(d) Data Transfer Rate: it is the speed with which data is transferred

 

 

 

(a) Twisted Pair Cable: It consists of two identical 1mm thick copper wires insulated and twisted together 

 

Advantages:

 

(i) It is easy to install and maintaining

 (ii) It is inexpensive.

(iii) It is incapable to carry a signal over long distances without the use of repeaters.

 

Disadvantages:

 

(ii) Due to low band width, these are unsuitable for broadband applications.

 

 (b) Coaxial Cables: It consists of a solid wire core surrounded by one or more foil or braided wire shields.

 

Advantages:

(i) Data transmission rate is better than twisted pair cables.

(ii) It is inexpensive.

Disadvantages:

 

(1) Expensive than twisted pair cables.

(ii) Difficult to manage and reconfigure.

 

 (c) Optical fiber: It consists of thin glass fibres that can carry information in the form of visible light

 

Advantages:

 

(iv) Bandwidth is up to 10 Gbps.

 

Disadvantages:

 

(1) Expensive as compared to other guided media.

 

(ii)Need special care while installation.

 

(d) Infrared: The infrared light transmits data through the air and can propagate throughout a room

 

Advantages:

 

(i) Power consumption is used.

 

(ii)Circuitry cost is less Secure mode transmission.

 

Disadvantages:

 

(1) Transmit data over long distance with high security.

 (ii) Data transmission speed is high.

 

(iii) Provide better noise immunity.

 

Limited in a short range. Can be blocked by common materials like walls, people, plants, etc...

(e) Radio wave: It is an electromagnetic wave with a wavelength between (0.5) cm and 30,000 m.

 

Advantages:

Radio wave transmission offers mobility

 

(i) It is cheaper than laying cables and fibers (ii) It offers ease of communication over difficult terrain. STRAND

 

Disadvantages:

Radio wave communication is insecure communication.

 

Radio wave propagation is susceptible to weather effects like rains, thunder storms, etc.

 (1) Microwave The microwave transmission is a line of sight transmission. radiowaves of more tha 3ghz frequency are known as microwaves.

 

Advantages:

 

It is cheaper than laying cable or fiber.

 (ii) It has the ability to communicate over oceans.

 

(i) Microwave propagation is susceptible to weather effects like rains, thunder storms, etc. Satellite link: The satellite transmission is also a kind of line of sight transmission that is used to trail signals throughout the world. It is a microwave relay system.

 

Disadvantages:

 

Microwave communication is an insecure.communication...

 

Advantages: 

(ii) No line of sight restrictions such as natural mountains, tall buildings, towers, etc.

 (iii) Earth station which receives the signals can be fixed position or relatively mobile.

 

Disadvantages:

 

(1) Area covered is quite large.

 

(2) Very expensive as compared to other transmission mediumInstallation is extremely complex 

(3) Signals sent to the stations can be tampered by external interference.

 

Network Devices

 

These are units that mediate data in a computer network and also called network equipments.

 

(a) Modem: It facilitates communication between computers over telephone line's

 

 (b) RJ45 Connector: it is used to connect computers on the local area network

 

(c) Ethernet card: It is used to support a special LAN architecture called Ethernet that uses bus or star topology and supports data transfer rate of upto 10 Mbps 

(d) Hub: It is used to connect several computers together

 

(e) Switch: It is used to divide a network into sub networks to prevent traffic over loading

 

 (f) Gateway It connects two dissimilar networks.

 

(g) Repeater it amplifies the signal being transmitted over a networking

 

 >

Network Topologies:

the way nodes of a network are interconnected is called network topology.

 (a) Bus Topology: It uses a common single cable to connect all the workstations

 

(b) Star Topology: It is based on a central which acts as a hub. 

(c) Tree Topology: It combines the characteristics of the linear bus and star topologies.

 

>

Network Types:

(a) LAN(Local Area Network): It is a network that is confined to a relatively small area.

 

(b) MAN (Metropolitan Area Network): It is a network that covers a group of nearby corporate offices in a city

 

(c) WAN (Wide Area Network): These are the networks spread over large distances, say across countries or ev continents through cabling or satellite uplinks 

(d) PAN(Personal Area Network): It is a computer network organized around an individual person.

 

Network Protocol: 

It is a set of rules that define how two systems communicate.

 

(a) Hypertext Transfer Protocol (HTTP) it defines the transfer of hypertext, graphic, image, saundarya messages,etc on WWW

 (b) FTP (File Transfer Protocol): defines transfer of files across internet

(c) TCP/IP (Transmission Control Protocol/ Internet Protocol) at is the basic network protocol for transfer .

(d) SMTP Simple Mail Transfer Protocol) it is used for fetching mails from the remote server. (e) POP3 (Post Office Protocol Version3); it is used for spending messages.

 

TERMS RELATED TO INTERNET 

www is a set of protocols that allows the acces of any document on the net.

>HTML: It is a document layout and hyperlink specification language.

 

XML: It is a markup language for documents containing structured information. > URL: It is Uniform Resource Locator, which is a special address for resources on the internet.

 

Domain Names: A character based internet address is known as a Domain name. Website: web site is a collection of web pages that are linked together.

 

> Web Address: Every web site has a unique address called the web address 

> Web server. It is a WWW server that responds to the requests made by the web browser

 

>Web Browser: A web browser is a WWW client that navigates through the world wide web and displays web pages. 

> WEB Hosting: It is a means of hosting web-server application on a computer through which electronic content on

 

the internet is readily available to any to any web-browser client.c.

Tuesday, 24 January 2023

Python Data Structures | mr indian coder |

 

Python Data Structures

Data Structures are a way of organizing data so that it can be accessed more efficiently depending upon the situation. Data Structures are fundamentals of any programming language around which a program is built. Python helps to learn the fundamental of these data structures in a simpler way as compared to other programming languages.

 

Python Data Structures

 

In this article, we will discuss the Data Structures in the Python Programming Language and how they are related to some specific data Types.

 

 

DATA STRUCTURES

A data structure is an organized group of data of different data types which can be processed as a single unit

 

 

Lists are the container which store the heterogeneous elements of any type. A stack is a linear data structure implemented in LIFO (Last In First Out) manner

 

 

 

Insertion and deletion both occurs only at one end known as TOP

Adding data into stack is called PUSH

Removing data from stack is called POP

 

Peek refers to inspecting the value at stack's without removing it.

 

Overflow refers to condition when one tries to PUSH an item in a stack that is full.

 

Underflow refers to condition when one tries to POP an item from a stack that is empty.

 

> stacks in Python can be implemented using lists.

 

 

 

 

 

 

 

 

 

Tags:-

 

Python data structures and algorithms interview questions

Python data structures interview        

Python data structures coursera assignment 7.1    

Python data structures durgasoft    

Python data structures interview questions    

Python data structures

Python data structures and algorithms    

Python data structures interview questions    

Python data structures and algorithms pdf   

Python data structures cheat sheet    

Python data structures and algorithms course    

Python data structures and algorithms bookres chapter 8 quiz

 

Python revision notes

 

In this post you will get Python revision notes for all whether for students of class 10,12 or graduation level.which will help in almost all types.of exams such cbse board,state board etc.follow this blog for more information and notes for preparation and comment your queries in mr indian coder.

python revision notes:

 Python revision notes class 12    

Python study notes    

Python study notes pdf    

Python version notes    

Python revision tour notes    

Python revision tour 2 notes    

Class 11 python revision NOTES

 

 


 

PYTHON INTRODUCTION 

Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed to be highly readable. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages.

python revision notes:

 Python revision notes class 12    

Python study notes    

Python study notes pdf    

Python version notes    

Python revision tour notes    

Python revision tour 2 notes    

Class 11 python revision notesFeatures of python

Python is Interpreted − Python is processed at runtime by the interpreter. You do not need to compile your program before executing it. This is similar to PERL and PHP.

 

Python is Interactive − You can actually sit at a Python prompt and interact with the interpreter directly to write your programs.

 

Python is Object-Oriented − Python supports Object-Oriented style or technique of programming that encapsulates code within objects.

 

Python is a Beginner's Language − Python is a great language for the beginner-level programmers and supports the development of a wide range of applications from simple text processing to WWW browsers to games.

FILE HANDLING

 

> Files are used to store huge collection of data and records permanently

 

Need for a Data File way to deal with large of data.

 

(a) It is a convenient

 

(b) To avoid input of data multiple times during program execution. (c) To share data between various programs

 

Types of files

 

(a) Text files

 

(b) Hinary Files

 

(c) CSV files

 

read() readline() and readlines() methods are available for reading data from the file.

 

>write() and write lines() are used for writing data in the file

 

pickle module is used in senalization of data. dump and load functions are used to write and read data from file.

 

The open() function creates a file object which would be utilized to call other methods associated with it. access mode: It determines the mode in which the file has to be opened Le, read, write, append, etc. This

 

optional parameter and the default file access mode is read (r). file (): This is same as open().

 

>Types of file path (a) Absolute file path: It specifies the location of a file from root.

 

(b) Relative file path: it specifies the location of a file from the current directory: >Reading from a CSV file is done using the reader object

 

Delimiter specifies the character used to separate each field. You can also write to a CSV file using a writer object and the write_row() methods.

 

> File Pointer tells the current position in the file where the reading or writing will take place. tell() function returns the current position of the file pointer

 

>seek() function changes the position of file pointer by placing the pointer at the specified position, syntax <object>.seek(offsell,model) here offset specifies the number of bytes

 

>mode is a number 0,1 or 2 signifying beginning current or end of file. flush() force writes the contents of the butter of the file.

 

> renamed() renames a file syntax: <file object>, rename(<old filename>,<new file name>) remove(): deletes a file.

 

cs.path.join(): joins two parts of a file path.

 

> os.path.split(): splits a file path into individual components.

 

os path.splittext)) > os.path.exists(): checks for the existence of a file path.Python revision notes

python revision notes:

 Python revision notes class 12    

Python study notes    

Python study notes pdf    

Python version notes    

Python revision tour notes    

Python revision tour 2 notes    

Class 11 python revision notes

Monday, 23 January 2023

Understanding Python Functions: A Beginner's Guide to Writing Efficient Code

 FUNCTIONS




> The act of partitioning a program into individual components is called Modularity .


The Python modules that come preloaded with Python are called "standard library modules"


> A function is a named block of statements that can be invoked by its name. Python can have three types of functions Le, built-in functions, functions in modules and user-defined functions.


> Examples of Some Built-in Functions


(1) print()


(ii) input()


(iii) sorted()


(iv) bool() 


(v) min()


> User defined functions: A user defined function can be defined as per the following format: def <function name>(parameters])


> a function in Python may or may not return a value.


> Functions returning a value is known as fruitful function and a function not returning 

any value is known as void or non-fruitful function



> values that are passed to a function are known as arguments and the values being received in function header are known as parameters.


>there are two kinds of scopes in Python 

Global scope: names defined in the top level segment of a program have a global scope.

 >local scope: names defined inside a function body have a local scope.


Python follows LEGB rule for name scope resolution



Tags 

python enumerate, enumerate python, python function, python documentation, python functions, python any, python all, functions in python, python def, def python, python built in functions, python open, python define function, function in python, python methods, function python, how to call a function in python, python function definition, how to define a function in python, functions python, def function python, define function python, python function example, python function parameters, how to create a function in python, python def function, defining functions in python, python documentation function, python function syntax, define a function in python,mr indian coder,mr indian,indian coder,Understanding Python Functions: A Beginner's Guide to Writing Efficient Code

Python 101: A Beginner's Guide to the Basics of Python

 REVISION OF THE BASICS OF PYTHON







> Python was created by Guido van Rossum in late 1980s (Released in 1991) at National Research Institute in the Netherland

> It is a case sensitive language.

> Python has a script mode and Internet mode both.

> Indentation: Blocks of code are denoted by line indentation, which is rigidly enforced.

 > Comments: A hash sign (#) that is not inside a string literal begins a single line comment.

> Tokens: smallest individual unit in a program is known as a token or a lexical unit. 


> Keywords: words that convey a special meaning to the Python compiler are known as keywords.


> Identifiers: These are the names given to different parts of the program.


> Literals: these are the data items that have a fixed value. Operators: These are tokens that trigger some computation.


> Dynamic Typing: In Python, the value that a variable points to has a type. In Python a variable is not assigned any data type it gets the data type of the value it points to at the time of the execution of the program. A variable in Python can be made to point to a value of different data type during the execution of the program. 


>Static Typing: In static typing a data type is attached with a variable when it is defined first and it is fixed.


>Multiple Assignment: Python allows you to assign a single value or multiple values to multiple variables in a single statement. to several variables simultaneously


For example: a=b=c=1

a, b, c=1,2, "john"


> Data type : Python offers following built in core data types. These are Numbers, Strings, list, tuple, dictionaries 


> Numbers can be either integers, floating point or complex numbers.


> Sequence is an ordered collection of items, indexed by integers starting from 0. Sequenced can be grouped into strings, tuples and lists. >Strings are lines of text that can contain any character. They can be declared with double quotes.


>Lists are used to group other data. They are similar to strays.


>A tuple consists of a number of values separated by commas.


> A set is an unordered collection with no duplicate items.


> Immutable types are those that can never change their value. Integers, floating point numbers, booleans, strings and tuple are Immutable. 


>Mutable types are those that allow changes in their contents. lists and dictionaries are mutable.


> A dictionary is an unordered set of key value pairs where the keys are unique.


The order of execution of statements is known as flow of control. A selection construct is a statement blodk statements that is executed when a condition is satisfied. These are also called conditional statements


> The conditional statements in Python have the following forms.

(a) Simple of

 (b) The if-else conditional

(c) The if-elif conditional statements

 (d) Nested if







> Python provides three types of iterative statements.


 (a) Counting loops repeat a certain number of times eg :- for

(b) Conditional loops repeat until a certain condition is satisfied, eg :- while.

 (c) Nested loops. An error or a bug is anything in the code that prevents a program from compiling and dunning correctly. 


> There are three types of errors :-

(a) Compile Time errors occur at compile time.

These are of two types:

(i) Syntax errors occur when rules of programming language are misused. 

(ii) Semantics errors occur when statements are not meaningful.


(b) Run Time errors occur during the execution of a program. 

(c) Logical Errors occur due to programmer's mistaken analysis of the error


To remove logical errors is called debugging .


> A list is a standard data type of Python that can store a heterogeneous sequence of values.


(a) These are mutable (ie, modifiable), you can change elements of a list in place. 

(b) The lists are depicted through square brackets.

(c) To join two lists use + (concatenation) operator.

(d) List manipulation functions are:-

append(), insert(), extend().sort(), remove(), reverse() and pop().


> Tuples

(a) Tuples are immutable Python sequences, Le. you cannot change elements of a tuple in place. 

(b) Tuples store a reference at each index 

(c) Tuple manipulation functions are: 

Jen(), max(), min(), and tuple().


> Dictionaries

(a) Dictionaries in Python are a collection of some key-value pairs.

 (b) These are mutable and unordered collection with elements in the form of a key: value pairs that associate kry

(c) To manipulate dictionaries functions are: len), clear(), has_key.items(), keys(), values(), update()

 (d) The membership operators in and not in work with dictionary keys only.

> Strings in Python are stored as individual character in contiguous location, with two way index for each location Strings are immutable and hence item assignment is not supported.


> Following operations can be used on strings

(1) Concatenation '+'

 (2) Replications '*'

(3) Membership in and not in

(4) Comparison Operators String Function

==,!=,<,>,<=,>=


> String Functions :-

(i) partition() 

(ii) join()

(iii) split()


> Any Python file can be referenced as a module.


> Modules are accessed by using the import statement import statement can


import x, y, z from x import a, b, c.


> Mathematical functions: these can be accessed by importing math module.


(i) sqrt(): find the square root of a specified expression 

(ii) pow():compute the power of a number

(iii) fabs(): Returns the absolute value of vas a float. 

>The math module of Python provides math functionality.


> The command line sys.argy arguments is another way that we can grab input.

> The basic VO (Input/Output) functions are input) and print)) respectively


> ceil(x): Returns the ceiling of x as a float, the smallest integer value greater than or equal to x.

> floor(x): Returns floor of x as a float, the largest integer value less than or equal tox

> fabs(x): Returns the floating point absolute value of x


> Random Functions: these can be accessed using tandem module


(i) random()

 (ii) choice()


> Statistics Module: these can be accessed using statistics module


(i) mean()

(ii) median()

 (iii) mode()





Tags 





python, python programming, learn python, python tutorial, python coding, learning python, w3schools python, how to learn python, python documentation, python language, python syntax, python basics, tutorialspoint, learn python for free, learn python free, free python course, python learning, python tutorial for beginners, python programming for beginners, learn python online, w3 python, python tutorials, geeks for geeks python, coding basics python, learn python 3, basics of python programming, python coding beginners