Python is a widely used general-purpose, high level programming language. It was initially designed by Guido van Rossum in 1991 and developed by Python Software Foundation. It was mainly developed for emphasis on code readability, and its syntax allows programmers to express concepts in fewer lines of code.
Python is a programming language that lets you work quickly and integrate systems more efficiently.
There are two major Python versions- Python 2 and Python 3. Both are quite different.
Beginning with Python programming:
1) Finding an Interpreter:
Before we start Python programming, we need to have an interpreter to interpret and run our programs. There are certain online interpreters like https://ide.geeksforgeeks.org/, http://ideone.com/ or http://codepad.org/ that can be used to start Python without installing an interpreter.
Windows:There are many interpreters available freely to run Python scripts like IDLE ( Integrated Development Environment ) which is installed when you install the python software from http://python.org/
Linux:For Linux, Python comes bundled with the linux.
2) Writing first program:
Following is first program in Python
Let us analyze the script line by line.
Line 1 : [# Script Begins] In Python comments begin with #. So this statement is for readability of code and ignored by Python interpretor.
Line 2 : [print(“GeeksQuiz”)] In a Python script to print something on the console print() function is used – it simply prints out a line ( and also includes a newline unlike in C ). One difference between Python 2 and Python 3 is the print statement. In Python 2, the “print” statement is not a function, and therefore can be invoked without a parenthesis. However, in Python 3, it is a function, and must be invoked with parentheses.
Line 3 : [# Script Ends] This is just another comment like Line 1.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
- Python 3 basics
- Setting up the environment in Java
- Keywords in Python | Set 1
- How to check if a string is a valid keyword in Python?
- Array in Python | Set 1 (Introduction and Functions)
- Transpose a matrix in Single line in Python
- Loops and Control Statements (continue, break and pass) in Python
- What is the maximum possible value of an integer in Python ?
- Important differences between Python 2.x and Python 3.x with examples
- Interesting facts about strings in Python | Set 1
- Python | Set 3 (Strings, Lists, Tuples, Iterations)
- Python | Set 2 (Variables, Expressions, Conditions and Functions)
- Increment and Decrement Operators in Python
- Difference between Abstract Class and Interface in Java
- Python – The new generation Language