Basic syntax of python language, Basic Computer Science

Assignment Help:
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!

Related Discussions:- Basic syntax of python language

Third generation of computers, THE THIRD GENERATION (1966-1975) ...

THE THIRD GENERATION (1966-1975) The introduction of IBM-360 series of computers in 1965 marked the beginning of this generation. The transistors were replaced by solid

What is Semaphore and explain with example?, Description A semaphore is a...

Description A semaphore is a confined variable whose value can be accessed and changed only by the operations P and V and initialization operation known as ''Semaphoiinitislize''.

Describe the protocol used by the mmu, Question 1: a) A distinction is...

Question 1: a) A distinction is often made between computer architecture and computer organisation. Describe, using examples, the meaning of computer architecture. b) Name

Sequential reading in fcb files, Earlier than anything we must describe the...

Earlier than anything we must describe the file transfer area or DTA. With the intention of sequentially read we use the 14H function of the 21Hinterruption.The register to be read

Define opportunity cost, Define opportunity cost The opportunity cost...

Define opportunity cost The opportunity cost of any commodity is defined as the cost of next best alternative, which has been sacrificed for producing the given commodity. Th

Ms word, what is ms words in parts ms words in life?

what is ms words in parts ms words in life?

Assembly, can you help me to do my assembly program homework

can you help me to do my assembly program homework

statistics, write a 2 page essay operational gaming and monte carlo simula...

write a 2 page essay operational gaming and monte carlo simulation

Explain master slave j-k flip flop, Question 1 Convert the following binar...

Question 1 Convert the following binary numbers to its specified number system 1101.11 (2) to octal 1111 (2) to decimal 110.11 (2) to hexadecimal 1011.11 (2) to

Create a database in access, The following are required: Create a ...

The following are required: Create a project in Access.  Your database must have flow and a theme. The database must be normalized.  The content m

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd