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

System software: System software helps run the  computer hardware and system. It is designed to control the operations of a computer and coordinate all external devices like c


CONCEPT OF PROGRAMMING LANGUAGE: In order to communicate with other human beings, one needs some language or a medium. In the same way for solving problems, a programming  lan

#Assignment 1: Project Management and Information Security Write a two to three (2-3) page paper that addresses the following: Explicate in detail the importance of project managem


Question 1 What are the different stages of evolution of Computer Architecture? Explain in detail Question 2 What are the components of Instruction Set architecture? Discu

Transaction-based model: Here,  the pricing is based on providing a committed business service, for ex, processing payroll for a global company as part of HR offering and this

4. Provide a list of productid’s, the name of the vendor and their credit rating. The results should be ordered by last name and then by credit rating. Write out the SQL that wo

change 778 into binarynumber