Browse by Domains

Append in Python| How is Append function used in Python

Let’s start with what is python and why this language becomes so popular and famous these days.

So In this tutorial, we will discuss about:

  1. What is Python?
  2. How Python was invented?
  3. Applications of Python
  4. What is append in python?

What is Python?

Python is an object-oriented , general-purpose interpreted, interactive, and high-level programming language. Python was invented for to  design a rapid prototyping of complex applications and it has various  interfaces to many OS system. It is a cross platform language and if you want to integrate your java or .net project to Python that is also available and invoking C and C++ libraries is also possible. Many giant companies use the Python programming language include NASA, Google, YouTube, BitTorrent, etc.Python programming is widely used in Artificial Intelligence, Natural Language Generation, Neural Networks and other advanced fields of Computer Science which are mostly used by the companies to use and  handle their unstructured or semi structured data. Python had deep focus on code readability & this class will teach you python from basics. 

How Python was invented?

Guido van Rossum

Python is invented by Guido van Rossum in 1989. Rossum used to love watching comedy movies from late seventies. He needed a short, unique, and slightly mysterious name for his language. In that time he was watching Monty Python’s Flying Circus and from that series he decided to keep his language name python. This how Python invented

Applications of Python

1) Web Applications

Python is used  to develop web applications and it has multiple  libraries to handle the internet protocols such as HTML and XML, JSON, Email processing, request, beautifulSoup, Feedparser, etc.Let me give a small brief for each of them:

  1. HTML: Full form of  HTML stands for  Hyper Text Markup Language and it is the standard  markup language for Web pages. HTML elements are the building blocks of HTML pages and the elements of HTML are represented by <> tags
  2. JSON:  Full form of JSON stands for the JavaScript Object Notation and it is a lightweight format for storing and transporting data. JSON is mostly used when the data is sent from a server to a web page and this is a  “self-describing” notation and easy to understand
  3. Beautiful soup:  Beautiful Soup is basically a  Python library which is used to get data from the  HTML, XML, and other markup languages.Let me give you a example, suppose you’ve seen some web pages which has the data relevant to your research or interest, like date or address information. And you need those data but that do not provide any facility to download the data directly. To solve this problem Beautiful Soup comes into the problem to help you fetch the particular content from the web page. It automatically removes the HTML markup and saves the information to your system . Basically you can describe beautiful soup as a tool which helps to do  web scraping and also helps you clean up and parse the documents you have fetch down from the web. The Beautiful Soup documentation will has various facilities which will give you a sense of a variety of things that the Beautiful Soup library will help with. Beautiful soup starts working from isolating titles and links, to extracting all of the text from the HTML tags, to altering the HTML within the document everything.

So these are main facilities we get when we use Python as our language for web application

Now Let’s have a look at the Python web-framework. Django is one of the most popular framework and currently  Instagram is using Django.

And Python has multiple frameworks like this

  • Django and Pyramid framework(Use for heavy applications)
  • Flask and Bottle (Micro-framework)
  • Plone and Django CMS (Advance Content management)

2) Desktop GUI Applications

So what is GUI?

Full form of GUI stands for the Graphical User Interface. It provides a smooth and hassle free interaction to any application. Python has the  Tk GUI library to develop a user interface and let’s explore  some popular GUI libraries in Python

  • Tkinter or Tk
  • wxWidgetM
  • Kivy (used for writing multitouch applications )
  • PyQt or Pyside

3) Console-based Application

Before start with control based application let’s have a brief understanding about Console-based applications.

What is console Based application?

This applications execute from the command-line or shell and these applications are based on computer program which need commands to execute. This kind of application was more popular and familiar with the old generation’s of computers.

Python has a feature which can develop and execute  this kind of application very effectively and smoothly. It is famous for having REPL, which stands for the Read-Eval-Print Loop that makes it the most suitable language for the command-line applications.

Python has uncountable number of freely available libraries or modules which actually help to build the command-line apps. The basic necessity of  IO libraries are  to read and write and also helps to parse argument and create console help text out-of-the-box.  If you want to work with the advance part that is also available and there have advance libraries that can develop independent console apps.

4) Software Development

Python is one of most favourable and useful language for the software development procedure. It also work as a support language and python can be used to build control and management, testing, etc.

  • SCons is majorly used for to build control.
  • Buildbot and Apache Gumps are used for automated continuous compilation and testing.
  • Round or Trac for bug tracking and project management.

5) Scientific and Numeric

The most powerful domain of Artificial intelligence is the scientific and numeric part where the machine can perform the task  same as the human does. Python language is the most used and suitable language for Artificial intelligence or machine learning and  it has many scientific and mathematical libraries, which actually  makes our life easy to handle with complex equations.

To start with any  machine learning algorithms we require complex mathematical calculation to handle our data. Python uncountable libraries to solve these  scientific and numeric tasks such as Numpy, Pandas, Scipy, Scikit-learn, etc.

If you have the basic knowledge of Python then also you can start your journey with machine learning by importing these libraries on the top of the code.

  • SciPy
  • Scikit-learn
  • NumPy
  • Pandas
  • Matplotlib

6) Business Applications

So we all know that the business Applications are very different from the standard applications. E-commerce and ERP are an example of a business application and this kind of application are required extensively everyday. These business problems requires extra scalability and readability, and Python provides all these features very easily.

7) Audio or Video-based Applications

Python is very flexible and advance when comes to perform multiple tasks and to create multimedia applications. Some multimedia applications which are actually invented by using Python are TimPlayer, cplay, etc.

  • Gstreamer
  • Pyglet
  • QT Phonon

8) 3D CAD Applications

Before start with CAD let’s have a look at what is CAD?

The CAD stands for the Computer-aided design which  is used to design engineering related architecture. Main domain for CAD is to develop the 3D representation of a part of a system. Python can also create a 3D CAD application by using the few libraries like:

  • Fandango (Popular )
  • CAMVOX
  • HeeksCNC
  • AnyCAD
  • RCAM

9) Enterprise Applications

Python can be used to create applications that can be used within an Enterprise or an Organization and some of the real-time applications are OpenERP, Tryton, Picalo, etc.

10) Image Processing Application

Python is the one of most used language which has multiple number of libraries that are used to work with the image. The image can be manipulated according to our requirements.

  • OpenCV
  • Pillow
  • SimpleITK

What is append in Python?

Append in python language is a method that is used to add an item to the end of the list. It is a Python in build function and use to manipulate the list.

What is List?

Python List provide a concise way to create list which is ordered and changeable.

The syntax of the append() method is:

list.append(item)

append() Parameters:

append()  method takes a single argument

  • item – an item which is to be added at the end of the list

The item can be :

  1. numbers
  2. strings
  3. dictionaries,
  4. another list etc.
Example 1: Adding an Element to a List using append method
# fruit list
fruits = ['Mango', 'Apple', 'Banana']

# 'Grapes' is appended to the fruit list
animals.append('Grapes')

# Updated fruit list
print('Updated fruit list: ', fruits)

Updated fruit list:  ['Mango', 'Apple', 'Banana','Grapes]
Example 2: Adding List to a List using append method
# fruit list
fruits = ['Mango', 'Apple', 'Banana']


# list of another fruit list
another_fruitlist = ['Orange', 'Licchi']

# appending another sets of fruit list to the fruits list
fruits.append(another_fruitlist)

print('Updated fruit list: ', fruits)
Updated fruit list:  ['Mango', 'Apple', 'Banana', ['Orange', 'Licchi']]

 

I hope this tutorial will help you to understand the concept of append function.To get a free course on Python language click the banner below

append in python
Sampriti Chatterjee

Leave a Comment

Your email address will not be published. Required fields are marked *

Great Learning Free Online Courses
Scroll to Top