Basic syntax of python language, Basic Computer Science

The Python language has a lot of similarities to Perl, C and Java. Though, there are some specific differences between the languages.
First Python Program:
relative Mode Programming:
Calling up the interpreter exclusive of passing a script file as a parameter brings up the following on time:
$ python
Python 2.5 (r25:51908, Nov 6 2007, 16:54:01)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-27)] on linux2
Type "help", "copyright", "credits" or "license" for more info.
>>>
The following text you have to type to the right of the Python prompt and push the Enter key:
>>> print "Hello, Python!";
This will generate following result:
Hello, Python!
Script Mode Programming:
Calling up the interpreter by a script parameter starts execution of the script and continues until the script is ended. When the script is ended, the interpreter is no longer active.
Let us write a easy Python program in a script. All python files will have conservatory .So place the following source code in a test.py file.
#!/usr/bin/python

print "Hello, Python!";
Here we implicit that you have Python interpreter available in /usr/bin directory. Now attempt to run this program as follows:
$ chmod +x test.py # This is to make file executable
$ python test.py
This will generate following outcome:
Hello, Python!
Posted Date: 5/4/2012 9:24:50 AM | Location : United States







Related Discussions:- Basic syntax of python language, Assignment Help, Ask Question on Basic syntax of python language, Get Answer, Expert's Help, Basic syntax of python language Discussions

Write discussion on Basic syntax of python language
Your posts are moderated
Related Questions
ELEMENTS OF CPU: The CPU is a complex IC chip having millions of transistors. As mentioned earlier, a CPU has three major identifiable parts: Control Unit (CU), Arithmetic & l

WAP TO ACCEPT MARKS OF THREE SUBJECT FOR STUDENT & CALCULATE TOTAL MARKS AND PERCENTAGE

what is the first computer in this world

The use of manage files very much facilitates the creation of files and programmer can focus on other aspects of the programming lacking worrying on details which can be handled by

Nursing Care Activity Module Retrieving of identification data of patient  Assessment of the patient  - Physical - Mental - Personal - Socio-c

In this assignment, you should create a class called ToDoMenu which has a main method that contains the code that implements a command-line menu for managing a collection of ToDoIt

In assembly language code lines have two fractions, the earliest one is the name of the instruction which is to be executed, and the next one are the parameters of the command. For

Uninformed Search Strategies: To be able to undertake a regular search, our entire agent ought to know is the starting state, the possible operators and how to check whether th

No charges are reimbursed to the patient until the deductible has been met. Hospital visits are reimbursed at 80% and Lab visits are reimbursed at 70%. Doctor''s office visits are

My question on the following link: http://www.3n33.com/upload/download.php?img=1410