On Github gdbhosale / pythontutorial
Created by Dwij IT Solutions / Ganesh Bhosale
Python is a widely used general-purpose, high-level programming language that lets you work more quickly and integrate your systems more effectively.
Its design philosophy emphasises code readability, and its syntax allows programmers to express concepts in fewer lines of code
Python was conceived in the late 1980’s and its implementation was started in December 1989 by Guido van Rossum in the Netherlands.
By default python comes pre-installed in Ubuntu distribution. Check simply by command:
python --version
set path=%path%;C:\python27You will see Python (command line) in Windows Menu. Make sure it runs and opens Python Shell Window
The latest version of Mac OS X, Yosemite, comes with Python 2.7 out of the box. Check simply by command:
python --version
If not you can install it from https://www.python.org/downloads/mac-osx
Simply by putting command python in terminal you can start python interpretor for Ubuntu/Mac. For windows open Python (command line) from Windows Menu.
The interpreter’s line-editing features include interactive editing, history substitution and code completion on systems that support readline.
The interpreter operates somewhat like the Unix shell: when called with standard input connected to a tty device, it reads and executes commands interactively.
Press to get command history. When commands are read from a tty, the interpreter is said to be in interactive mode. In this mode it prompts for the next command with the secondary prompt which has three dots representation (...), instead of (>>>) which is primary prompt. To exit interpreter: Use Ctrl+D in Linux & Mac Use Ctrl+Z and then Enter in Windows
>>>(7+2)*10 90 >>>print “Hello World” Hello World >>>i=90 >>>i 90 >>>print i*(i+10) 9000
python SimpleProgram.pyLet’s see How to write programs in Python !!!
x = 34 - 23 # Acomment. y = "Hello" # Another one. z = 3.45 if z == 3.45 or y == "Hello": x = x + 1 y = y + "World" # String concat. print x print y