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

Explain FDM : Frequency Division Multiplexing, Frequency Division Multiplex...

Frequency Division Multiplexing : FDM is an analog technique that is applied when he bandwidth of link is greater than the combined bandwidth of the signals to be transmitted. a

BUS STRUCTURE, Ask question #WHAT IS TWO BUS STRUCTURE

Ask question #WHAT IS TWO BUS STRUCTURE

Explain the configuration steps involved in cmos setup, Question 1 Explain...

Question 1 Explain the important concepts of modern CPU Question 2 Discuss the instructions that need to follow while installing new mother board Question 3 Explai

Use triggers to maintain referential integrity, At times, Brewbean''s has c...

At times, Brewbean''s has changed the id number for existing products. In the past, they have had to add a new product row with the new id to the BB_PRODUCT table, modify all the c

What is the intent of the singleton pattern, QUESTION Consider a Univer...

QUESTION Consider a University system which has several sub systems: Student Registration Module Registration Time Tabling Library System Human Resource Manag

Perform a mail merge to send invitation, Question Elaborate the various...

Question Elaborate the various steps in performing a Mail Merge. Perform one mail merge operation for sending invitation for a conference which is being conducted in your organ

Processor, Processor: Processor plays major role in a computer. One sh...

Processor: Processor plays major role in a computer. One should carefully decide about the type of processor and its speed before making a choice. Currently Core 2 Duo process

How is the ack request formed, QUESTION a) The handling of the INVITE t...

QUESTION a) The handling of the INVITE transaction in SIP is completely different from the handling of other transactions. The handling of the INVITE is one of the most complex

How is python Using Blank Lines and Waiting for the User, A line holds onl...

A line holds only whitespace, probably with a comment, is identified as a blank line, and Python completely avoids it. In an interrelated interpreter session, you need to enter an

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