Fatskills
Practice. Master. Repeat.
Study Guide: Python Programming: An Introduction to Python
Source: https://www.fatskills.com/python/chapter/python-programming-an-introduction-to-python

Python Programming: An Introduction to Python

By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.

⏱️ ~3 min read

Python is a commonly used language which one can easily understand and apply. You can make nearly anything using Python. Most systems today (Mac, Linux, UNIX, etc.) have Python installed as a default setting since it is an open source and free language. Upon reading this book, you are going to become fluent in this awesome code language and see it applied to a variety of examples. No type declaration of methodology, parameters, functions, or variables (like in other languages) are found in Python making its code concise and easy.

You can use the language in everything if you want to build a website, make a game, or even create a search engine.

The big benefit of using Python is, an explicit compiler is not necessary since it’s an entirely interpreted language (Perl, Shell, etc.).

The file extension which is used by Python source file is “.py” and it is a case-sensitive language, so “P” and “p” would be considered as two different variables.

Also, Python figures out the variable type on its own, for example, if you put x=4 and y=’Python’ then it will consider x as an integer and y as a string. We are going to learn all these basics in detail in further chapters.

A few important points to remember are:
1. For assigning a value “=” is used, and for comparison “==” is used.

Example, x=4, y=8, x==y

2. “print” is used to print results.
3. All the mathematical operations like +, -, *, /, % are used with numbers
4. Variable is created when a value is assigned to it. Example, a=5 will create a variable named “a” which has an integer value of 5. There is no need to define it beforehand.
5. “+” can also be used to concatenate two string. Example, z= “Hi”, z= z + “Python”
6. For logical operations “and”, “or”, “not” are used instead of symbols.
          
We use three general data types: integer (by default for numbers), floats (a=3.125) and string. The string is shown by either “” (double quotes) or ‘’ (single quotes). We will look at all the types of data with various examples in the upcoming chapters.

Let’s look at the step by step guide to install Python on a Windows operating system. As mentioned earlier, if you are using another operating system like UNIX or Linux or Mac then Python should be installed already and ready to use.

You have to use “%python” to get the details on Linux, press “CTRL + D” to exit. For running it on UNIX, “%python filename.py” is used. Python prompts with three “greater than” symbol (>>>).