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
The elif statement permits you to check multiple expressions for truth value and execute a block of code the moment one of the conditions estimates to true. similar to the else, th

Server In a network, the resources of computers comprising network are usually shareable. In fact, one of the main objectives of networking is to make the computing resources

Department (DeptNo, DeptName, Office, Phone) Employee (EmpNo, FirstName, LastName, JobTitle, HireDate, Salary, MgrNo, Deptno) Customer (CustNo, CompanyName, Street, City, State, Zi

Greedy Search-artificial intelligence: If we have a heuristic function for states, as defined above, then we may simply measure each state with respect to this measure an

advantage and disadvantage of operating system

Question 1 Explain the configuration steps involved in CMOS setup Date and time Error halt Floppy drive A Halt on Hard disk C HDD Delay Keyboard Memory

QUESTION We wish to use the Kaiser window method to design a discrete-time filter with generalized linear phase that meets specifications of the following form:

Mobile telephone networks started with analog technology. Analog cellular networks were known as first generation (1G) networks. Such networks had limited capacity, and were subjec

Necessary Nurses Records The software should generate all registers/reports in detail summary for various permutations and combinations of options. A powerful SQL (Structure

Question 1 How can you create surface with 3D Scanner in geometric modeling? Question 2 Explain kinematics modeling in virtual reality Question 3 Describe object hierarc