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 is the use of system bus ?, The system bus is a cable which carries da...

The system bus is a cable which carries data communication among the major components of the computer, as well as the microprocessor. Not all of the communication that uses the bus

Input/output (i/o) unit, Input/output (I/o) unit: This unit provides th...

Input/output (I/o) unit: This unit provides the interface between the computer and the computer peripherals. A computer peripheral is any unit, which is attached to, but is no

., why first generation computers are better than fourth generation compute...

why first generation computers are better than fourth generation computers

Python Strings and Python Lists, Python Strings: Strings in Python are rec...

Python Strings: Strings in Python are recognized as an adjacent set of characters in among quotation marks. Python permits for either pairs of single or double quotes. Subsets of s

Ultrasonic waves, Ultrasonic Waves: Sound waves outside the audible range o...

Ultrasonic Waves: Sound waves outside the audible range of humans. Ultrasonic waves consist of frequencies greater than 20 kHz and exist in excess of 25 MHz. Applications include i

Coaxial cables, Coaxial Cables: Another metallic transmission medium w...

Coaxial Cables: Another metallic transmission medium which offers a large bandwidth, is the coaxial cable. Such cables consist of an outer protective shell made of copper tube

#title, what is HMtl stands for, meaning and purpose

what is HMtl stands for, meaning and purpose

How to crack a password, how can i crack the password of vmware virtual mac...

how can i crack the password of vmware virtual machine

Arrays and strings, This is a C file. 1. The program starts by printing you...

This is a C file. 1. The program starts by printing your name with an end sign ">". For example, "NAME >"; 2. Then, you can type in a string. If the string is not "vi xxx", you pri

Write the function pop in c, QUESTION (a) Convert each of the following...

QUESTION (a) Convert each of the following expressions to prefix and postfix. (i) (A+B)*(C+D) (ii) A-B/(C*D^E) (^ denotes exponentiation) (b) The following algorithm c

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