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

What are the Software interruptions, Software interruptions can be thoroug...

Software interruptions can be thoroughly activated by the assembler invoking the number of the preferred interruption with the INT instruction. The use of interruptions aids us in

Browser cookies, Browser Cookies: A cookie is a small message sent by ...

Browser Cookies: A cookie is a small message sent by the Web server to a your web client. This message is stored by the browser as a text file. The basic purpose of cookie is

Computer programming, outline and explain in detail any 10 application area...

outline and explain in detail any 10 application areas of vb.net

Web browser, Web Browser:   A Web browser is software application that ...

Web Browser:   A Web browser is software application that enables you to find, retrieve, and display information available on the World Wide Web (WWW). Browser also allows you

Visual basics, Assume that s is a string variable  that is supposed to con...

Assume that s is a string variable  that is supposed to contain a value to be converted to integer. Write a fragment of code that converts the value to integer variable  and displ

Define Program formation process, For the formation of a program it is nece...

For the formation of a program it is necessary to follow five steps: Design of the algorithm, stage the problem to be solved is reputable and the best solution is proposed, creatin

Block matching algorithm, I am using block matching algorithm to get the mo...

I am using block matching algorithm to get the motion vectors, now, how can I get the depth map/depth value from the motion vectors?

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

write advantages and disadvantages of private and public network

Explain process creation and process termination, Question 1 Explain diffe...

Question 1 Explain different functions of an operating system. Explain the evolution of operating systems Question 2 Explain process creation and process termination Ques

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