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

MIS, information system providors

information system providors

Management information system, Is IT a strategic weapon or a survival tool?...

Is IT a strategic weapon or a survival tool? Discuss.

Create email account, Create Email Account: For sending or receiving e...

Create Email Account: For sending or receiving email, you need to have to an email account. The email account may be provided by the organization for which you are working or

Dbms, Explain displaying an er schema as an er diagram, Database Management...

Explain displaying an er schema as an er diagram, Database Management System

Search problems in artificial intelligence, Specifying Search Problems ...

Specifying Search Problems In our agent terms, a problem to be solved is a particular task where the agent starts with the environment in a given state and acts upon the enviro

Software engineering, how will a poorly conducted feasibility study affect ...

how will a poorly conducted feasibility study affect an implemented system

Explain the important concepts of modern cpu, Question 1 Explain the impor...

Question 1 Explain the important concepts of modern CPU CISC vs. RISC CPUs Circuit Size and Die Size Processor Speed Processor Cooling System Clocks Architect

Pep8, Write an Assembly program that reads an integer (-32,768 through 32,7...

Write an Assembly program that reads an integer (-32,768 through 32,767) in decimal and prints its equivalent in binary. The output must show all 16 bits. And you must use a loop

Purchasing a database program, When purchasing a database program, you must...

When purchasing a database program, you must have a clear idea of what you need it for. Ask yourself the following questions. (1) Will it perform all (he operations necessary f

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