PYTHON
Python tutorial provides basic and advanced concepts of Python. Our Python tutorial is designed for beginners and professionals.
Python is a simple, general purpose, high level, and object-oriented programming language.
Python is an interpreted scripting language also. Guido Van Rossum is known as the founder of Python programming.
Our Python tutorial includes all topics of Python Programming such as installation, control statements, Strings, Lists, Tuples, Dictionary, Modules, Exceptions, Date and Time, File I/O, Programs, etc. There are also given Python interview questions to help you better understand Python Programming.
What is Python
Python is a general purpose, dynamic, high-level
, and interpreted programming language. It supports Object Oriented programming approach to develop applications. It is simple and easy to learn and provides lots of high-level data structures.
Python is easy to learn yet powerful and versatile scripting language, which makes it attractive for Application Development.
Python's syntax and dynamic typing with its interpreted nature make it an ideal language for scripting and rapid application development.
Python supports multiple programming pattern, including object-oriented, imperative, and functional or procedural programming styles.
Python is not intended to work in a particular area, such as web programming. That is why it is known as multipurpose programming language because it can be used with web, enterprise, 3D CAD, etc.
We don't need to use data types to declare variable because it is dynamically typed so we can write a=10 to assign an integer value in an integer variable.
Python makes the development and debugging fast because there is no compilation step included in Python development, and edit-test-debug cycle is very fast.
Python History
Python was invented by Guido van Rossum in 1991 at CWI in Netherland. The idea of Python programming language has taken from the ABC programming language or we can say that ABC is a predecessor of Python language.
There is also a fact behind the choosing name Python. Guido van Rossum was a fan of the popular BBC comedy show of that time, "Monty Python's Flying Circus". So he decided to pick the name Python for his newly created programming language.
Python has the vast community across the world and releases its version within the short period.
Python Basic Syntax :
There is no use of curly braces or semicolon in Python programming language. It is English-like language. But Python uses the indentation to define a block of code. Indentation is nothing but adding whitespace before the statement when it is needed.
For example -
def function():
statement 1
statement 2
…………………
…………………
statement N
Python First Program
Unlike the other programming languages, Python provides the facility to execute the code using few lines. For example - Suppose we want to print the "Hello World" program in Java; it will take three lines to print it.
Ex:
public class HelloWorld {
public static void main(String[] args){
System.out.println("Hello World");
}
}
Output :
print("Hello World")
Python print() Function
The print() function displays the given object to the standard output device (screen) or to the text stream file.
Unlike the other programming languages, Python print() function is most unique and versatile function.
The syntax of print() function is given below.
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
Let's explain its parameters one by one.
objects - An object is nothing but a statement that to be printed. The * sign represents that there can be multiple statements.
sep - The sep parameter separates the print values. Default values is ' '.
end - The end is printed at last in the statement.
file - It must be an object with a write(string) method.
flush - The stream or file is forcibly flushed if it is true. By default, its value is false.
0 comments:
Post a Comment