Welcome to Python!
Python is a high-level programming language, with applications in numerous areas, including web programming, scripting, scientific computing, and artificial intelligence!
It is very popular and used by organizations such as Google, NASA, the CIA, and Disney.
There are almost no limitations on what can be built using Python. These include standalone apps, web apps, games, data science and machine learning models, and much more.
To use Python, you first need to install it on your computer from here.
Let's start off by creating a short program that displays "Hello world!".
In Python, we use the print statement to output text.
Python has the capability of carrying out calculations.
Enter a calculation directly into the print statement:
Python also carries out multiplication and division, using an asterisk * to indicate multiplication and a forward slash / to indicate division.
Use parentheses to determine which operations are performed first.
Floats are used in Python to represent numbers that aren't integers (whole numbers).
Some examples of numbers that are represented as floats are 0.5 and -7.8237591.
They can be created directly by entering a number with a decimal point, or by using operations such as division on integers.
As you saw previously, dividing any two integers produces a float.
A float is also produced by running an operation on two floats, or on a float and an integer.
print(8/2) print(6*7.0) print(4+1.65)
Besides addition, subtraction, multiplication, and division, Python also supports exponentiation, which is the raising of one number to the power of another. This operation is performed using two asterisks.
You can also use floats in exponentiation.
For example, the following code will result in the square root of 9:
Floor division is done using two forward slashes and is used to determine the quotient of a division (the quantity produced by the division of two numbers).
The code above will output 3, because 6 goes into 20 three times.
The modulo operator is carried out with a percent symbol (%) and is used to get the remainder of a division.
These were some basic concepts in Python. In the next blog of this Python Core Series, we'll learn about Strings and Variables.
Till then, stay tuned. Thanks!