A: When you are talking about programming languages, it is very difficult to select one language as the best because all of them have their own features and advantages. Python is one such programming language which is really famous for its flexibility and simplicity. It can be used to develop applications for a wide variety of platforms including Windows, Mac, Unix and Linux. It is a high level programming language that can be used to create a wide range of applications from GUI programs to web application and scientific computation. Python is a versatile language and can be used to develop both large scale systems as well as small scale applications.
A: In this article, we will discuss the features of Python language and also learn how to write a simple program using it.
A: The following section contains five steps that must be followed when learning basic python programming for beginners.
A: Step 1: Create a file with ‘Editor’ and name it ‘python_basics.py’. Save it on the Desktop. This will be your first program in python language. The editor should be selected as ‘Notepad’.
A: Step 2: Now open the file created in step 1 by double clicking on it from the desktop. This will open a window where you need to write the following code:
print "This is my first python program"
A: Step 3: Now save this file by selecting the option ‘Save’ in the File menu. This will save the file in the .py format which is used by python language. This file can now be executed by double clicking on it or by executing it from the command prompt. You can find out more about this by writing help() when you are in the python prompt.
A: Step 4: This program will print “This is my first python program” in the console when you run it. So, run this file by double clicking on it or by running it from the command prompt in DOS mode. Once you do this, you will see that the output is displayed in the console after pressing enter key on your keyboard.
A: Step 5: Now you have learnt how to write a basic python program, so create another file named ‘myfile.py’ in the same folder. Write the following code in this file:
print "This is my second python program"
A: Now save it using the ‘Save’ option in the File menu. Now double click on this file or run it from the command prompt to execute it. You can see that “This is my second python program” will be displayed in the console after pressing enter key on your keyboard.
A: Learning basic python programming for beginners is quite easy if you follow these steps correctly.