Wednesday, August 28, 2019

Python-programming-language

Introduction to Python Programming

Python is developed by Guido van Rossum. Guido van Rossum started implementing Python in 1989. Python is a very simple programming language so even if you are new to programming, you can learn python without facing any issues.
In this course, you'll learn the fundamentals of the Python programming language, along with programming best practices. You’ll learn to represent and store data using Python data types and variables, and use conditionals and loops to control the flow of your programs. You’ll harness the power of complex data structures like lists, sets, dictionaries, and tuples to store collections of related data. You’ll define and document your own custom functions, write scripts, and handle errors. Lastly, you’ll learn to find and use modules in the Python Standard Library and other third-party libraries.
What is python ?
  • The Python programming language is freely available and makes solving a computer problem almost as easy as writing out your thoughts about the solution. The code can be written once and run on almost any computer without needing to change the program.

Comparing Python to Other Languages

No alt text provided for this image
  • Python is often compared to other interpreted languages such as Java, JavaScript, Perl, Tcl, or Smalltalk. Comparisons to C++, Common Lisp and Scheme can also be enlightening. In this section I will briefly compare Python to each of these languages.
  • These comparisons concentrate on language issues only. In practice, the choice of a programming language is often dictated by other real-world constraints such as cost, availability, training, and prior investment, or even emotional attachment.

Java

Python programs are generally expected to run slower than Java programs, but they also take much less time to develop. Python programs are typically 3-5 times shorter than equivalent Java programs. This difference can be attributed to Python's built-in high-level data types and its dynamic typing. For example, a Python programmer wastes no time declaring the types of arguments or variables, and Python's powerful polymorphic list and dictionary types, for which rich syntactic support is built straight into the language, find a use in almost every Python program.
For these reasons, Python is much better suited as a "glue" language, while Java is better characterized as a low-level implementation language. In fact, the two together make an excellent combination. Components can be developed in Java and combined to form applications in Python; Python can also be used to prototype components until their design can be "hardened" in a Java implementation.

Javascript

Python's "object-based" subset is roughly equivalent to JavaScript. Like JavaScript (and unlike Java), Python supports a programming style that uses simple functions and variables without engaging in class definitions. However, for JavaScript, that's all there is. Python, on the other hand, supports writing much larger programs and better code reuse through a true object-oriented programming style, where classes and inheritance play an important role.

Perl

Python and Perl come from a similar background (Unix scripting, which both have long outgrown), and sport many similar features, but have a different philosophy. Perl emphasizes support for common application-oriented tasks, e.g. by having built-in regular expressions, file scanning and report generating features.

Tcl

Like Python, Tcl is usable as an application extension language, as well as a stand-alone programming language. However, Tcl, which traditionally stores all data as strings, is weak on data structures, and executes typical code much slower than Python. Tcl also lacks features needed for writing large programs, such as modular namespaces. Thus, while a "typical" large application using Tcl usually contains Tcl extensions written in C or C++ that are specific to that application, an equivalent Python application can often be written in "pure Python".
Tcl 8.0 addresses the speed issuse by providing a bytecode compiler with limited data type support, and adds namespaces. However, it is still a much more cumbersome programming language.

Smalltalk

Perhaps the biggest difference between Python and Smalltalk is Python's more "mainstream" syntax, which gives it a leg up on programmer training. Like Smalltalk, Python has dynamic typing and binding, and everything in Python is an object. However, Python distinguishes built-in object types from user-defined classes, and currently doesn't allow inheritance from built-in types.
Python has a different philosophy regarding the development environment and distribution of code. Where Smalltalk traditionally has a monolithic "system image" which comprises both the environment and the user's program, Python stores both standard modules and user modules in individual files which can easily be rearranged or distributed outside the system.

C++

Almost everything said for Java also applies for C++, just more so: where Python code is typically 3-5 times shorter than equivalent Java code, it is often 5-10 times shorter than equivalent C++ code! Anecdotal evidence suggests that one Python programmer can finish in two months what two C++ programmers can't complete in a year. Python shines as a glue language, used to combine components written in C++.

Common Lisp and Scheme

These languages are close to Python in their dynamic semantics, but so different in their approach to syntax that a comparison becomes almost a religious argument: is Lisp's lack of syntax an advantage or a disadvantage? It should be noted that Python has introspective capabilities similar to those of Lisp, and Python programs can construct and execute program fragments on the fly. Usually, real-world properties are decisive: Common Lisp is big (in every sense), and the Scheme world is fragmented between many incompatible versions, where Python has a single, free, compact implementation.

Top 10 Reasons To Learn Python

No alt text provided for this image
Programming languages have been around for ages, and every decade sees the launch of a new language sweeping developers off their feet. Python is considered as one of the most popular and in-demand programming language. A recent Stack Overflow survey showed that Python has taken over languages such as Java, C, C++ and has made its way to the top. This makes Python certification one of the most sought-after programming certifications. Through this blog, I will be listing down the top 10 reasons to learn Python.
Get ready to fall in love with Python!!
Below are the major features and applications due to which people choose Python as their first programming language:

1. Python’s Popularity & High Salary

  • Python engineers have some of the highest salaries in the industry. The average Python Developer salary in the United States is approximately $116,028 per year.
  • Also, Python has a strong spike in popularity over the last 1year. Refer the below screenshot taken from Google Trends.
  • I hope my blog on “Top 10 reasons to learn Python” was relevant for you. To get in-depth knowledge on Python along with its various applications, check out our interactive, live-online Credo systemz Python training here, that comes with 24*7 support to guide you throughout your learning period.

2. Data Science

  • Python is the leading language of many data scientist. For years, academic scholars and private researchers were using the MATLAB language for scientific research but it all started to change with the release of Python numerical engines such as ‘Numpy’ and ‘Pandas’.
  • Python also deals with the tabular, matrix as well as statistical data and it even visualizes it with popular libraries such as ‘Matplotlib’ and ‘Seaborn‘. 

3. Scripting & Automation

Many people only knows that Python is a programming language, but Python can also be used as Scripting language. In scripting:
  • The code is written in the form of scripts and get executed
  • Machine reads and interprets the code
  • Error checking is done during Runtime
Once the code is checked, it can be used several times. So by automation, you can automate certain tasks in a program. 

4. Big Data

  • Python handles a lot of hassles of data. It supports parallel computing where you can use Python for Hadoop as well. In Python, you have a library called “Pydoop” and you can write a MapReduce program in Python and process data present in the HDFS cluster.
  • There are other libraries such as ‘Dask‘ and ‘Pyspark‘ for big data processing. Therefore, Python is widely used for Big Data where you can easily process it!

5. Testing Framework

  • Python is great for validating ideas or products for established companies. Python has many built-in testing frameworks that covers debugging & fastest workflows. There are a lot of tools and modules to make things easier such as Selenium and Splinter.
  • It supports testing with cross-platform & cross-browser with frameworks such as PyTest and RobotFramework. Testing is a tedious task and Python is the booster for it, so every tester should definitely go for it!

6. Computer Graphics

  • Python is largely used in small, large, online or offline projects. It is used to build GUI and desktop applications. It uses ‘Tkinter‘ library to provide fast & easy way to create applications.
  • It is also used in game development where you can write the logic of using a module ‘pygame’ which also runs on android devices.

7. Artificial Intelligence

  • AI is the next huge development in the tech world. You can actually make a machine mimic the human brain which has the power to think, analyze and make decisions.
  • Furthermore, libraries such as Keras and TensorFlow bring machine learning functionality into the mix. It gives the ability to learn without being explicitly programmed. Also, we have libraries such as openCv that helps computer vision or image recognition.

8. Web Development

  • Python has an array of frameworks for developing websites. The popular frameworks are Django, Flask, Pylons etc. Since these frameworks are written in Python, its the core reason which makes the code a lot faster and stable. 
  •  You can also perform web scraping where you can fetch details from any other websites. You will also be impressed as many websites such as Instagram, bit bucket, Pinterest are build on these frameworks only.

9. Portable & Extensible

  • The portable and extensible properties of Python allow you to perform cross-language operations seamlessly. Python is supported by most platforms present in the industry today ranging from Windows to Linux to Macintosh, Solaris, Play station, among others.
  • Python’s extensibility features allow you to integrate Java as well as .NET components. You can also invoke C and C++ libraries.

10. Simple & Easy To Learn

So at number 10, Python is extremely simple and easy to learn. It is a very powerful language and it closely resembles the English language!
So, what contributes to its simplicity? Python is
  • Free & open source
  • High-level
  • Interpreted
  • Blessed with large community
Furthermore, in Python, you don’t have to deal with complex syntax.
If you have to print ‘hello world’, you have to write above three lines whereas in Python, just one line is sufficient to print “hello world”. It’s that SIMPLE guys!
So the 10th reason lies in the simplicity of the code which makes the best suit for beginners.

Conclusion

I believe the trial has shown conclusively that it is both possible and desirable to use Python as the principal teaching language:
  • it is Free (as in both cost and source code).
  • it is trivial to install on a Windows PC allowing students to take their interest further. For many the hurdle of installing a Pascal or C compiler on a Windows machine is either too expensive or too complicated;
  • it is a flexible tool that allows both the teaching of traditional procedural programming and modern OOP; It can be used to teach a large number of transferable skills;
  • it is a real-world programming language that can be and is used in academia and the commercial world;
  • it appears to be quicker to learn and, in combination with its many libraries, this offers the possibility of more rapid student development allowing the course to be made more challenging and varied;
  • and most importantly, its clean syntax offers increased understanding and enjoyment for students;
Python should be used as the first year teaching language. If used it will be possible to teach students more programming and less of the peculiarities of a particular language. Teaching a mid-level language like C in just one day is inadvisable. Too much time must be spent teaching C and not enough time teaching generic skills to students with no programming experience.
In conclusion, Python offers the optimum compromise of teachability and applicability.