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

Flowcharting, Flowcharting: Flowcharting: A Flowchart is a graphical r...

Flowcharting: Flowcharting: A Flowchart is a graphical representation of an algorithm. It can be compared to the blueprint of a building. Just as a building contractor refers

What are the three basic security provided by ssl, QUESTION (a) Can SSL...

QUESTION (a) Can SSL be used to encrypt email data? Justify your answer (b) What are the three basic security provided by SSL? (c) State the port number used by applicati

Transfer instructions, They are utilized to move the contents of the operat...

They are utilized to move the contents of the operators. Each instruction can be used with many different modes of addressing. MOV MOVS (MOVSB) (MOVSW) MOV INSTRUCTION Principle: D

Explain the effects of a lack of communication, Question 1 Explain the dif...

Question 1 Explain the different categories of Software applications Question 2 Write a note on Data Dictionaries Question 3 Explain the following (a) Top-down testin

Software, Software Computer cannot be used without a software in...

Software Computer cannot be used without a software in it. It is the software which gives instructions to the hardware of the computer so as to work all devices in tande

Describe gamma and its importance, Question 1 Describe HSV and CMYK color ...

Question 1 Describe HSV and CMYK color models Question 2 Describe gamma and its importance Question 3 What are the steps involved in image manipulation? Que

Define segments in assembly process?, The architecture of the x86 processor...

The architecture of the x86 processors forces with the use of memory segments to direct the information, the size of these segments is of 64kb. The cause of being of these segments

Negative Messages and Blog Related Assignment, Writing Assignment 1: You...

Writing Assignment 1: Your boss wants to know about the risks of corporate blogging and recommended policies to prevent companies from liability. Write a properly informal for

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