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

Computer, hitory and genration of computer

hitory and genration of computer

Scheme, There is a path between two vertices if there is a series of edges ...

There is a path between two vertices if there is a series of edges that you can use to travel between them. For example, between vertices 1 and 3 above, there is a path made up of

Java programming, Write a program that lets the user play the game Rock, Pa...

Write a program that lets the user play the game Rock, Paper, Scissors against the computer. The program should work as follows: ? When the program begins, the results of the prev

Project, how to set up the location (e.g. plaza, hall of fame, lecture thea...

how to set up the location (e.g. plaza, hall of fame, lecture theater or etc.) and services that will be used during the exhibition; devices needed; and finally produced a compreh

Gov problem, "The government is auctioning off oil leases at two sites: 1 a...

"The government is auctioning off oil leases at two sites: 1 and 2. At each site, 100,000 acres of land are to be auctioned. Cliff Ewing, Blake Barnes, and Alexis Pickens are biddi

Some CPUs provide multiple modes of operation, even though most systems onl...

even though most systems only distinguish among user and kernel modes, some CPUs provide multiple modes. Multiple modes could be used to provide a finer-grained security strategy.

C++, whats the out put of int main(){ int n=310; funcone(n); functwo(&n); ...

whats the out put of int main(){ int n=310; funcone(n); functwo(&n); cout return 0; } void funcone(intn) n=240; } void func two(intn*) { n=120; }

Networking.., write advantages and disadvantages of private and public netw...

write advantages and disadvantages of private and public network

flow chart for online placement, Create systems flow chart and state trani...

Create systems flow chart and state tranistion diagram for online placement and consultancy

Assignment - concept of programming language , Assignment :  It is compose...

Assignment :  It is composed of variable name, an assignment operator of the language and a value or variable or some expression as per composition allowed based on rules defined

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