Python Programming
Oct 25, 2023 by Ankit Srivastava
Categories
Enroll Now to Access Multiple Intensive Courses for Free
What is Python ?
- Python is a programming language.
- It was created by Guido van Rossum, and released in 1991.
- Python use interpreter as its language processor.
- Unlike other programming languages , Python uses new lines to complete a command.
- Python relies on indentation to define scope such as the scope of loops, functions and classes.
What can Python do?
- Python is used to develop GUI Programs, Web Applications, websites, Games, scripts, etc.
- Python can be used on a server to create web applications
- One of the most popular frameworks for building web applications in Python is Django, along with Flask.
- Python programming language is used mostly everywhere in tech field. It is used in Data Science, AI, Machine learning etc.
- Python can be used to handle big data and perform complex mathematics.
Why Python?
- Python has a simple syntax, when compared to other programming languages.
- As we know , Python runs on an interpreter system, meaning that code can be executed as soon as it is written.
- Python is a versatile programming language that supports multiple programming paradigms, including procedural, object-oriented, and functional programming.
Python Installation:
- If you find that you do not have Python installed on your computer, then you can download it for free from the following website: https://www.python.org/
- To write Python code we need IDE (Integrated Development Environment) , PyCharm and Visual Studio Code being the most popular of all.
Understanding First Code :
What did the code do?
- In this code we wrote a print function which allows us to print anything written inside the function in double quotes.
- Let us consider an example of Social media platforms that use automatic content printing to notify you of new friend requests, messages, likes, and comments, helping you stay up to date with your network.
- Anything enclosed in double quotes , is considered to be a string.
Python Indentation:
- Indentation in python is very important. It indicates a block(group) of elements.
- Tabs or leading whitespaces are used to compute the indentation levels of a line.
- It depends on you whether you want to use tabs or whitespaces.
Indentation Error:
- In python , a block of elements needs to have the same indentation level.
- Python will give you an error if you skip the indentation.
- The number of spaces is up to you as a programmer.
- You have to use the same number of spaces in the same block of code, otherwise Python will give you an error.
Python Comments:
- Comments in python are commonly used to clarify or explain codes.
- Comments are not interpreted by python. Meaning , comments will not be executed.
- There are two types of comments in Python :-
- Single Line Comments
- Multiple Line Comments
Displaying output in Python
- To display an output in python , you need to use a special keyword print.
- Use print() function to display output.
- We can print a string , number or character using this function.
- The print() function can also be used to print two objects using comma (,).
- Share:
Fundamentals are covered very thoroughly!