Home Blog

What is Python? A brief Introduction to Python Language.

What is Python

Let’s start with introduction to python.

In a simple words: it is one of the popular and widely used programming language right now. But what makes it so popular and widely used? Below are some characteristics of this language

1. Python is an interpreted language.

2. Python is a high-level object oriented language.

3. It is Powerful

4. It is cross-platform (portable)

5. It is Extensible

6. It is Free to use

7. It has a good online community support.

8. And the most important of all: it is easy to get starts with.

Python is an interpreted language unlike Java: a true compiled base language.

Basically in most of the high level programming language, executing an application follows following steps:

  • Write one or more source file to create an application (source file in Java)
  • Compile the source file into object files(byte-codes in java)
  • Link the object files into an application(through JVM in Java)
  • Execute the application through virtual Machine.

But with interpreted scripting languages like python, the process is direct.

  • Write the source code in one or more files
  • Execute application through interpreter by supplying source files.

The Python interpreter itself compiles the source files into series of internal byte-code format and the inbuilt “Python virtual Machine (PVM)” will execute the compiled program as an application.


Python: A high-level object oriented programming language.

It is a high-level language because, it separates user from the underlying operating system as much as possible. Though you can dig dipper as much as you can to understand how it interact on the ground level with operating system and hardware, you really don’t need to worry about most of the things and you can focus on executing your ideas through this language.

Since it is a true object-oriented language, everything in it is an object. Object is the base of python programming. In fact, variables in python are also object.


It is a powerful Programming language.

We all know that Python is a powerful language. But there are few things we need to know about why it is so powerful than other programming language.

Actually, there is very little you cannot do with Python. Surprisingly, the core of this language is very small. One of the main reason of it being so powerful is its extensible nature. You can extend your python application using C, C++, and even Java language. The Python interpreter also comes with huge library of Modules.

As we know that it is high level language but can be extended up to C Level language, you have very less things you cannot do with python.

It is very widely used in the field of mathematics, robotics, artificial intelligence, whether forecasting, space-program, text-processing, search-engine, Data-science and the list goes on and on which proves how powerful this language is.


It supports cross-platform.

Because of its platform independent nature, python is supported on a huge range of operating systems. It includes Tk extensions to build a user-interface applications. You can write a Python script on Windows platform and execute on Mac or Unix Platform almost without any modification on codes. Python also has some platform specific modules and extensions which helps you to run python application better on specific platform.


It is Extensible

You may know that Python is written in C and C++. And we all know that you can fully access the python source code, you can create an extensions to the language.

Python can be embedded on C or C++ applications which makes it a true extensible language. Jython is a Python interpreter written in Java. So that, you can write a Python program that interfaces to Java Objects, or you can write a Java application that uses Python objects. You can deploy a python application on Java supported environments even a web browser can directly execute a Python Scripts.


Python is Free to use

Although, most of the programming language are freely distributed. But you can write and deploy Python programs without having to purchase any software and without having to worry about licensing issues. You can even download the source code to the software if you want to take a closer look at how this language works.

Also read: What is Django? why should you learn Django.


It is easy to learn and has good online community support.

One thing any beginner programmer think while starting learning a new language is if the language is easy enough to get started with or not. And yes, it is one of the easiest programming language to get started with. You don’t require to download the very big environment like JDK (For Java) to write and execute the python codes.

You can simply download the it from the official site www.python.org and start writing python codes.

It also has very rich online documentation and community forum where you can put your query and get your problem solved easily.

It comes with built-in interpreter where you can test your codes like modules and statements before publishing your application or program.

What is Django? Why should I Learn Django?

Django is a web framework used to create a website. Django is not just another framework. It uses python programming language to create website.

Django is a very high level framework. You do not have to worry about most part of your project because Django will do it for you.

As we know that python is a high-level programming language and we don’t have to focus on underlying process like how the written code interact with hardware on basic level. The same thing apply to Django Framework. You can focus on the execution of your project while Django will do the back-end process for you.

Django has an explicit slogan: “THE WEB FRAMEWORK FOR PERFECTIONISTS WITH DEADLINES”

As you can understand from its slogan, the framework is for those people who wanted to create a perfect project with a deadline in their mind.

Django uses MVC (Model View Controller) pattern which helps to separate the logic from representation of your website.

Model View Controller Mechanism

Why Django?

Following are some benefits of using Django Framework (#from Django: Web development with Python Learning Path by packt):

Django is published under the BSD license, which assures that web applications can be used and modified freely without any problems; it’s also free.

-Django is fully customizable. Developers can adapt to it easily by creating modules or overridden framework methods.

-This modularity adds other advantages. There are lot of Django modules that you can integrate into Django. You can get some help with other people’s work because you will often find high-quality modules that you might need.

-Using python in this framework allows you to have benefits from all python libraries and assures a very good readability.

-Django is a framework whose main goal is perfection. It was specifically made for people who want clear code and a good architecture for their applications. It totally respects the Don’t repeat yourself (DRY) philosophy, which means keeping the code simple without having to copy/paste the same parts in multiple cases.

-With regards to quality, Django integrates lots of efficient ways to perform unit tests.

-Django is supported b a good community. This is a very important asset because it allows you to resolve issues and fix bugs very fast.  Thanks to the community, we can also find code examples that show the best practices.

Why Not Django?

Although, Django have lots of advantages to consider it as a first choice web framework. It do have some disadvantages also. Mainly if you are a beginner and don’t know much about console (because lots of things have to be done using shell or command-line applications like cmd / shell),  

Also, you may notice the change on some syntax with frequent update of Django framework.

Otherwise it is a perfect web framework to develop any Websites within a given deadline.

Builtin Object Types in Python Programming

builtin object types

Every programming language has a basic building blocks. The builtin object and statements are the most fundamental part of any language.

Read also: A brief introduction to Python Programming Language.

Just like other programming languages, Python has its own built-in objects.

Below are the Python Builtin Object Types:

  1. Number
  2. String
  3. List
  4. Dictionary
  5. Tuple
  6. File*

*File is an external data type supported by Python. You might find little odd to consider File as data types but, python supports access to files in much the same way that it supports access to the built-in object types.

Builtin Object : Number

Number is a simple data type that python uses to hold a number. Unlike C, where you have to specify the number types like integer, floating point etc., python automatically detects the correct data type for your entered value.

Within the number object, the format of the number entered determines the method in which the information is stored.

Following are some Format python uses to store the numerical values.

  • Integer Constants
number = 1257
number1 = -1257
  • Hexadecimal / Octal Constants
decimal = 654
hexadecimal = 0xff
octal = 0357
  • Long Integers
long=1232132132134654313464461346464646579874654167469464967464649674964665465L

Python has very sophisticated interpreter that even a significantly large number can be executed as a normal value.

  • Floating-Point Constants
number = 123.456
number = 45.125F19
number = -45.125
  • Complex Number Constants
complexNum = 1+2j
complexNumAgain = 4.3+3.4j

Builtin Object : Strings

In Python programming, string is a sequence of single character.

string = ‘hello world!’ 
anotherString = “welcome to python world”

You can use either single or double quotes to represent strings. You can easily include quoted texts on strings.

string = ‘hi, Robert says “you are beautiful” to you today’

You can explore more about Python string object type here.

Builtin Object :List

Lists are extended version of strings. You are bound to use only character sequence in string whereas in lists, you can store any types of data such as string, number, other lists, dictionaries or any kind of object types you create within the list.

Python lists are represented by enclosed square brackets [].

list = [1, 2, 3], list1 = [1, ‘hi’, 345, “Music is my life”] 

Using square brackets implies a list of objects.

Lists are referenced according to the index of the item. Index starts with 0.

name = [‘Robert’, ‘John’, ‘Henry’, ‘ford’]
print name[1]
result : John

Lists are mutable. And there are different methods to deal with lists like append () count () extend () index () sort () etc. which we have discussed on List Methods section.

Dictionaries

Dictionary in python programming is an objects container with a key-value pair enclosed with curly braces.

It is an associative array. We can access the values from dictionary by referring to the key associated with that value. Example:

detail = {‘name’ : ‘john’, ‘surname’ : ‘Mathew’, ‘address’ : ‘Hilton house, 24a’, ‘age’ : 34}

You can nest the dictionaries.

Just like Lists, Dictionaries also have different methods to deal with the objects inside it. We have discussed dictionary methods in details on Dictionary Methods section.

Tuples

Tuples are a lists that cannot be modified or changed.

They are identical with lists. The only difference between tuple and list is that: list is mutable and tuple is immutable. Which means, the information or objects once created cannot be modified or changed on tuples whereas it can be modify, add, remove, and filter on lists.

Tuples are enclosed in parentheses (lists are enclosed in square brackets). See the example below:

days = (‘Sunday’, ‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Saturday’)

Tuple supports the same basic operations as lists.

Files

Python handles Files as an object just like other inbuilt object types like strings, list, tuples, dictionary, and number.

We can create a file object by using the built-in open function. We can manage the Files by using different methods like read, write, close etc.

We have discussed Files on Files section on python programming.

I Enjoy Strawberry Deserts

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read. We have got to change our ethics and our personal financial system and our whole way of understanding the world. It has to be a world in which people live rather than die a sustainable world.

I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things. It’s the attitude you bring to clothes that make the difference. Everything I do is a matter of heart, body and soul.
Age and size are only numbers.

Confidence! If you have it, you can make anything look good

I still appreciate individuality. Style is much more interesting than fashion, really. Attitude is everything. It’s really easy to get colors right. It’s really hard to get black – and neutrals – right.

Happy couple
Style is much more interesting than fashion, really.

Travel With Friends All The Time

Never in my wildest dreams did I entertain the idea that I would become a fashion designer. I am no longer concerned with sensation and innovation, but with the perfection of my style.

I’ve treated the waistcoat as if it were a corset, so that it becomes the first layer in the process of putting clothes on the body. There is constant motion between layering and revealing.

A girl should be two things: classy and fabulous.

Take things that matter

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read.

I think it’s an old fashioned notion that fashion needs to be exclusive to be fashionable. I am no longer concerned with sensation and innovation, but with the perfection of my style.

You’re only as good as your last collection, which is an enormous pressure. Elegance is not the thing of those who have just escaped from adolescence.You have a more interesting life if you wear cool cloths.

Fashion is not something that exists in dresses only. Fashion is in the sky, in the street, fashion has to do with ideas, the way we live, what is happening.

Some people think luxury is the opposite of poverty.

Don’t miss the morning coffee!

I always thought what you wore underneath was as important as what you wear on top. Beauty is perfect in its imperfections, so you just have to go with the imperfections.

War taught me that not everything is glamorous. I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things.

When I was young, I lived like an old woman, and when I got old, I had to live like a young person.

The Things That Matter

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read. We have got to change our ethics and our personal financial system and our whole way of understanding the world. It has to be a world in which people live rather than die a sustainable world.

I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things. It’s the attitude you bring to clothes that make the difference. Everything I do is a matter of heart, body and soul.
Age and size are only numbers.

Confidence! If you have it, you can make anything look good

I still appreciate individuality. Style is much more interesting than fashion, really. Attitude is everything. It’s really easy to get colors right. It’s really hard to get black – and neutrals – right.

Happy couple
Style is much more interesting than fashion, really.

Travel With Friends All The Time

Never in my wildest dreams did I entertain the idea that I would become a fashion designer. I am no longer concerned with sensation and innovation, but with the perfection of my style.

I’ve treated the waistcoat as if it were a corset, so that it becomes the first layer in the process of putting clothes on the body. There is constant motion between layering and revealing.

A girl should be two things: classy and fabulous.

Take things that matter

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read.

I think it’s an old fashioned notion that fashion needs to be exclusive to be fashionable. I am no longer concerned with sensation and innovation, but with the perfection of my style.

You’re only as good as your last collection, which is an enormous pressure. Elegance is not the thing of those who have just escaped from adolescence.You have a more interesting life if you wear cool cloths.

Fashion is not something that exists in dresses only. Fashion is in the sky, in the street, fashion has to do with ideas, the way we live, what is happening.

Some people think luxury is the opposite of poverty.

Don’t miss the morning coffee!

I always thought what you wore underneath was as important as what you wear on top. Beauty is perfect in its imperfections, so you just have to go with the imperfections.

War taught me that not everything is glamorous. I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things.

When I was young, I lived like an old woman, and when I got old, I had to live like a young person.

Things You Should Pack When Travel

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read. We have got to change our ethics and our personal financial system and our whole way of understanding the world. It has to be a world in which people live rather than die a sustainable world.

I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things. It’s the attitude you bring to clothes that make the difference. Everything I do is a matter of heart, body and soul.
Age and size are only numbers.

Confidence! If you have it, you can make anything look good

I still appreciate individuality. Style is much more interesting than fashion, really. Attitude is everything. It’s really easy to get colors right. It’s really hard to get black – and neutrals – right.

Happy couple
Style is much more interesting than fashion, really.

Travel With Friends All The Time

Never in my wildest dreams did I entertain the idea that I would become a fashion designer. I am no longer concerned with sensation and innovation, but with the perfection of my style.

I’ve treated the waistcoat as if it were a corset, so that it becomes the first layer in the process of putting clothes on the body. There is constant motion between layering and revealing.

A girl should be two things: classy and fabulous.

Take things that matter

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read.

I think it’s an old fashioned notion that fashion needs to be exclusive to be fashionable. I am no longer concerned with sensation and innovation, but with the perfection of my style.

You’re only as good as your last collection, which is an enormous pressure. Elegance is not the thing of those who have just escaped from adolescence.You have a more interesting life if you wear cool cloths.

Fashion is not something that exists in dresses only. Fashion is in the sky, in the street, fashion has to do with ideas, the way we live, what is happening.

Some people think luxury is the opposite of poverty.

Don’t miss the morning coffee!

I always thought what you wore underneath was as important as what you wear on top. Beauty is perfect in its imperfections, so you just have to go with the imperfections.

War taught me that not everything is glamorous. I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things.

When I was young, I lived like an old woman, and when I got old, I had to live like a young person.

Summer Time Burn Out

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read. We have got to change our ethics and our personal financial system and our whole way of understanding the world. It has to be a world in which people live rather than die a sustainable world.

I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things. It’s the attitude you bring to clothes that make the difference. Everything I do is a matter of heart, body and soul.
Age and size are only numbers.

Confidence! If you have it, you can make anything look good

I still appreciate individuality. Style is much more interesting than fashion, really. Attitude is everything. It’s really easy to get colors right. It’s really hard to get black – and neutrals – right.

Happy couple
Style is much more interesting than fashion, really.

Travel With Friends All The Time

Never in my wildest dreams did I entertain the idea that I would become a fashion designer. I am no longer concerned with sensation and innovation, but with the perfection of my style.

I’ve treated the waistcoat as if it were a corset, so that it becomes the first layer in the process of putting clothes on the body. There is constant motion between layering and revealing.

A girl should be two things: classy and fabulous.

Take things that matter

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read.

I think it’s an old fashioned notion that fashion needs to be exclusive to be fashionable. I am no longer concerned with sensation and innovation, but with the perfection of my style.

You’re only as good as your last collection, which is an enormous pressure. Elegance is not the thing of those who have just escaped from adolescence.You have a more interesting life if you wear cool cloths.

Fashion is not something that exists in dresses only. Fashion is in the sky, in the street, fashion has to do with ideas, the way we live, what is happening.

Some people think luxury is the opposite of poverty.

Don’t miss the morning coffee!

I always thought what you wore underneath was as important as what you wear on top. Beauty is perfect in its imperfections, so you just have to go with the imperfections.

War taught me that not everything is glamorous. I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things.

When I was young, I lived like an old woman, and when I got old, I had to live like a young person.

High Five For Fitness

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read. We have got to change our ethics and our personal financial system and our whole way of understanding the world. It has to be a world in which people live rather than die a sustainable world.

I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things. It’s the attitude you bring to clothes that make the difference. Everything I do is a matter of heart, body and soul.
Age and size are only numbers.

Confidence! If you have it, you can make anything look good

I still appreciate individuality. Style is much more interesting than fashion, really. Attitude is everything. It’s really easy to get colors right. It’s really hard to get black – and neutrals – right.

Happy couple
Style is much more interesting than fashion, really.

Travel With Friends All The Time

Never in my wildest dreams did I entertain the idea that I would become a fashion designer. I am no longer concerned with sensation and innovation, but with the perfection of my style.

I’ve treated the waistcoat as if it were a corset, so that it becomes the first layer in the process of putting clothes on the body. There is constant motion between layering and revealing.

A girl should be two things: classy and fabulous.

Take things that matter

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read.

I think it’s an old fashioned notion that fashion needs to be exclusive to be fashionable. I am no longer concerned with sensation and innovation, but with the perfection of my style.

You’re only as good as your last collection, which is an enormous pressure. Elegance is not the thing of those who have just escaped from adolescence.You have a more interesting life if you wear cool cloths.

Fashion is not something that exists in dresses only. Fashion is in the sky, in the street, fashion has to do with ideas, the way we live, what is happening.

Some people think luxury is the opposite of poverty.

Don’t miss the morning coffee!

I always thought what you wore underneath was as important as what you wear on top. Beauty is perfect in its imperfections, so you just have to go with the imperfections.

War taught me that not everything is glamorous. I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things.

When I was young, I lived like an old woman, and when I got old, I had to live like a young person.

Shopping Is My Cardio

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read. We have got to change our ethics and our personal financial system and our whole way of understanding the world. It has to be a world in which people live rather than die a sustainable world.

I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things. It’s the attitude you bring to clothes that make the difference. Everything I do is a matter of heart, body and soul.
Age and size are only numbers.

Confidence! If you have it, you can make anything look good

I still appreciate individuality. Style is much more interesting than fashion, really. Attitude is everything. It’s really easy to get colors right. It’s really hard to get black – and neutrals – right.

Happy couple
Style is much more interesting than fashion, really.

Travel With Friends All The Time

Never in my wildest dreams did I entertain the idea that I would become a fashion designer. I am no longer concerned with sensation and innovation, but with the perfection of my style.

I’ve treated the waistcoat as if it were a corset, so that it becomes the first layer in the process of putting clothes on the body. There is constant motion between layering and revealing.

A girl should be two things: classy and fabulous.

Take things that matter

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read.

I think it’s an old fashioned notion that fashion needs to be exclusive to be fashionable. I am no longer concerned with sensation and innovation, but with the perfection of my style.

You’re only as good as your last collection, which is an enormous pressure. Elegance is not the thing of those who have just escaped from adolescence.You have a more interesting life if you wear cool cloths.

Fashion is not something that exists in dresses only. Fashion is in the sky, in the street, fashion has to do with ideas, the way we live, what is happening.

Some people think luxury is the opposite of poverty.

Don’t miss the morning coffee!

I always thought what you wore underneath was as important as what you wear on top. Beauty is perfect in its imperfections, so you just have to go with the imperfections.

War taught me that not everything is glamorous. I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things.

When I was young, I lived like an old woman, and when I got old, I had to live like a young person.

The True Story About How Fashion Trends Are Born

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read. We have got to change our ethics and our personal financial system and our whole way of understanding the world. It has to be a world in which people live rather than die a sustainable world.

I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things. It’s the attitude you bring to clothes that make the difference. Everything I do is a matter of heart, body and soul.
Age and size are only numbers.

Confidence! If you have it, you can make anything look good

I still appreciate individuality. Style is much more interesting than fashion, really. Attitude is everything. It’s really easy to get colors right. It’s really hard to get black – and neutrals – right.

Happy couple
Style is much more interesting than fashion, really.

Travel With Friends All The Time

Never in my wildest dreams did I entertain the idea that I would become a fashion designer. I am no longer concerned with sensation and innovation, but with the perfection of my style.

I’ve treated the waistcoat as if it were a corset, so that it becomes the first layer in the process of putting clothes on the body. There is constant motion between layering and revealing.

A girl should be two things: classy and fabulous.

Take things that matter

Elegance isn’t solely defined by what you wear. It’s how you carry yourself, how you speak, what you read.

I think it’s an old fashioned notion that fashion needs to be exclusive to be fashionable. I am no longer concerned with sensation and innovation, but with the perfection of my style.

You’re only as good as your last collection, which is an enormous pressure. Elegance is not the thing of those who have just escaped from adolescence.You have a more interesting life if you wear cool cloths.

Fashion is not something that exists in dresses only. Fashion is in the sky, in the street, fashion has to do with ideas, the way we live, what is happening.

Some people think luxury is the opposite of poverty.

Don’t miss the morning coffee!

I always thought what you wore underneath was as important as what you wear on top. Beauty is perfect in its imperfections, so you just have to go with the imperfections.

War taught me that not everything is glamorous. I didn’t want to be a fashion designer, and for a good half of my career I didn’t like it. I always wanted to do other things.

When I was young, I lived like an old woman, and when I got old, I had to live like a young person.

POPULAR POSTS

MY FAVORITES