Skip to main content

Python programming #1: Getting started with features and a sample program


            Hello everyone! Welcome to our channel HIGH-TECHDROID and this is Lavanya. Today, we are going to see about Python Programming. Let me begin with it’s history. Python was started to develop in the year of 1987 but it came to lime light since 4-5 years.

History:


           The major reason behind it is the non-availability of a proper community behind to develop and explore its features. Then, it’s features were being explored by major powers of the world like NASA, IBM, YouTube and Google and they began to develop their web applications using Python. Okay, let us get started by downloading and installing Python from the official website python.org. Before that, let you know that there are two versions of Python-Python 2.x and Python 3.x with sub-versions on each of them.

Download Page:


            If you go to Chrome and type python.org, you could find the homepage of Python official website. Go to Downloads and click on All Releases. You could find the download link of Python version 3.7.1. to download and install it. In case, if you are using Windows XP or previous versions, then Python 3.5+ versions are not compatible. Hence, you can opt for Python 2.7, Python 3.4 and other such versions. There are no major differences between Python 2.x and Python 3.x except few while finding it easy to learn. Coming back, let’s have a look at it’s features. Python is human readable language that makes it a high level programming language and speaking about dynamic feature, user can modify it in run time as they wish. Next is object oriented.

Difference between java & python:


          The best feature of Java is that it is totally an object-oriented one. Similarly, Python is also object-oriented with coding done based on an object. Next feature is lesser coding. We could throwback our memories of counting the number of pages before even reading the topic of the program. But python has saved us by its short and sweet nature. Next is, capability of automatic memory management.
          You need not do any specific actions regarding memory management as Python looks after it right from variable to files for memory allocation. On the way, next is several built-in ready-to-use libraries which is the major feature which on being explored has made its way to various fields which will be discussed soon.
          And less complexity, Python is generally a less complex language and simple one to learn so easily. Next is portability. Python allows its code to be run in different environments. For example, if you write a piece of code in Linux environment and want to export it to Windows environment, it is possible due to the portable nature of Python. Interpretable feature- this is the major difference between Java and Python. In Java, C or C++, we would compile the code which would yield a class file that is run to get the output. This is different, incase of Python as it interprets the code line-by-line and on occurrence of error, it needs to be cleared to proceed further. And the final one is embeddable. That is, python code can be embed in other languages like C or C++.

Applications:


            On learning Python, it is necessary that we should be aware of where we could use it. First is, Machine Learning, GUI development, Web applications development, Data analysis and Gaming. If you are interested in gaming, python will lead you to a bright future ahead. It is also used in the fields of Graphics and Computer vision which is regarding face recognition.

Major Differences:

            Here is the list of major differences between Python and Java. First is syntax. In Python, syntax is so easy, whereas Java is so Descriptive due to its verbosity. Indentation- Java has curly braces to define the scope whereas in Python, we give a Tab space to define the scope. Next is Semi-colon.
           There are none who would have not missed the semi-colon. But in python we need not bother about it as it is not required. Finally, it is Comment. We use # for single comment line and ””” for multi-line comments. And verbosity, as already mentioned, Java is a descriptive one. Will see it by first example,A sample class that is class Classnameand within the main function we had printed a statement Hello world.Here in java to print a Hello worldwe need a class, main function and a print statement and within that we also need to define a scope.so Java is so descriptive in nature.
            But python is so simple within the single line code we can print Hello world.And coming to protability both java and python are portable one.And Dynamically-typied  in this scenario java and python differs majorly.In java if you need to use a object first you have to declare it.But not in python here we can use it at a time.
            While coming to speed ofcourse Java is the fastest one,whereas in  python interpretation occursso it takes more time to interpretate line by line code.

Sample program:


            Now,we will start to write a sample program in python . I had downloaded and inatalled the python 3.6.5.Ok  As we seen theHello worldprogram in java,we will see it in python.This is a python IDE.We write a single line of code in this IDE also.See here a single line of code just if we give Hello worldwithin the print function,sure it will print it.Here the main(), scope is not necessary.I think now you will be clear about the difference between java and the python.
            Incase you are writing a set of code and if you wish to save the file, Go to file->New file. A untitled page/notepad will be opened,here you can write a set of code and save it also you can run it whenver needed.
            Ok we will see a sample program

Saving the file with python extension:


            Now we shall save a file,I am saving a file a hello.py .pyextension is compulsory.Now I going to run the file,hello,py program is running now
             
            Enter your name My name is Lavanya
   
            Asking your number 12345

Program Explanation:

         
         OUTPUT- see here Your name is Lavanya and your contact is 122345 as I entered.Now going back to the program. See here this code just with in three lines of code you get a input and also you can print it. I had told about Dynamically-typed here I haven't mentioned any datatype for the name .According to the input the datatype will be automatically assigned by python,For example see here I had given enter ur name within input.
           Whats my input ?? it a name given in string,python assing the datatype for the name as string automatically.Next enter  ur contact I mention it as int because python may assign it as string so while giving int the num is changed as integer data type .Now while printing within the print() I given enter ur name with in double quotes usually we will give +in java but here comma is required and I printed name and also a contact number.

Here is the video link presented of the above blog

                                            

That becomes the end of video,Thankyou for watching will see on next Blog.

Regards

04-11-2018






Popular post from this Blog

10 Best Websites To Download Paid Software For Free-Top 10n's

There are countless pirated software download sites on the internet to download premium software illegally. Likewise, popular torrent sites offer cracked software for free. Apart from being illegal, such activities put you at the risk of notorious malware and viruses. So, instead of taking a walk down the dark alley of torrents and malicious websites, take a look at our list of safe software download sites to download full version software for free and legally. #1ExtraTorrent Extratorrent is a free website to download and seed torrent files for various electronic resources. Downloadable files include movies, music, software, program, applications, e-books, documents, and many more. #2The Pirate Bay The Pirate Bay (TPB) is the world biggest torrent website wherein each day they provide 10,000 new files and offers free download for audio, video, application, games, and others. Swedish think tank Piratbyran founded it in 2003. #3Cracked Root Cracked ...

Avee Music Player (Pro) cracked for Android users

Avee Music Player (Pro)          In essence a lightweight music player that also have folder browsing, equalizer, song cross-fading and video playback capability.Still most notable features are audio visualizer and easy HD video production.While all visualizers are extensively customizable - color / shape / size / audio reaction / your own picture and more tweaks.Mobile solution to not stop producing videos, even when you are on the bus, boat or just walk in the park.Features:* Most popular media formats supported* Direct folder browsing with folder shortcuts* Customizable audio visualizers.* Export visualizer as hd video file.* Searchable library, queue, files, ...* Screen orientation lock* Read and save playlists (pla, pls, mpcpl, plp, m3u, m3u8)* Lock-screen and status bar widget* Supports media and blue-tooth controls* Sleep timer* Equalizer* Cross-fade and gap-less transitions* UI color skins* 2 types of internal playersList of songs seen in screensh...

KMSpico 10.2.0 Final Official™ ® Activator Windows & MS Office ® 2018

Download KMSpico 10.2.0 Final Official™ ® Activator Windows & MS Office ® 2018 KMSpico 10.2.0 is an activation tool that is used to activate the Microsoft Office and Windows products. This tool provides you the activation of both Microsoft products Office and Windows. The latest version of KMS Pico is worthy nowadays because you can’t purchase the activation keys for the different products all the time, and some features of this beneficial software can’t be utilized without activation. So, the user that is facing the difficulty of the unlicensed products just does follow the guidelines and use KMSpico final version to activate their products. KMSpico 10 Activator that is used to activate the Microsoft Office, Windows 7, 8 & 10. When you run this tool, some background processes starts that will help in the activation of the office and windows. All Versions are given below. Please follow the installation process before downloading the program from below....