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
Operating System: Operating  System is the software that manages all the computers' resources to optimize its performance provides common services for efficient execution of v

Understanding human intelligence in social AI can be taken as just the current tool in the philosopher's toolbox for answering of questions for the behaviour of human intellig

Problem When a data is sent across the network it is encrypted and arranged in a way that even if there is a diversion in the flow of data should not leak the data. At the rece

Question 1 Explain with an example the three kinds of relationships that are most important in object oriented modeling Question 2 Describe the Common Modeling techniques in

Question 1 Explain Wireless Protocol Requirements and also explain in brief medium access control protocol Question 2 Explain FDMA and TDMA concepts Question 3 Exp

classify computer system according to capacity. how they are different from computer according to the classification of technology.provide the comparative study also.

You can also allocate a single value to several variables at the same time. For instance: X=y=z =1 Now, an integer object is generated with the value 1, and all three variables are

Systems Software: Systems software is generally supplied by the hardware manufacturers. It includes operating systems, assemblers, compilers, and interpreters (to convert prog

QUESTION (a) Define four special target names use with the TARGET attribute (b) Explain the main difference between an HTML and an XHTML page (c) Give two merits and two

I need to create mulitple queues assignment that run concurrently. It is like a queue simulation with  number of checkouts with a random probability of clients, joining any one