Similar to other scripting languages Python has got more support online from technical forums and strong base made it popular.
It is easy to code in Python rather than most other programming or scripting languages.
One can test simple python commands on python shell invoked on any OS prompt like DOS shell or terminal on windows.
virtual-machine:~$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Note: This is Python3 course, so there are slight differences in python2 and python3. Please be aware of it.
A simple and famous "Hello World" program in python is as simple as below.
>>> print ("Hello World \n")
Hello World
>>> exit()
Above exit function is to close the interactive shell.
To write code in a file and execute it then follow the steps below. Single step code is written in a file test.py and executed using "python3 test.py" on linux terminal.
virtual-machine:~/python3_examples$ cat test.py
print ("Hello World \n")
virtual-machine:~/python3_examples$ python3 test.py
Hello World
Subscribe to:
Post Comments (Atom)
Featured Post
Introduction To Groovy Programming
Starting with the first program printing "Hello World". There is no interactive shell available like other scripting langugages t...
-
Traditional data types includes strings, Numbers, lists or arrays but Python has two more distinct data types. Those are tuple and dictionar...
-
<b>First:</b> Python keywords are very basic at the stage of learning this scripting language. These are most commonly and frequ...
-
Similar to other scripting languages Python has got more support online from technical forums and strong base made it popular. It is easy to...
No comments:
Post a Comment