DEV Community

Cover image for End Of Year With Python Programming Language🍕🥂
Adam Alex
Adam Alex

Posted on

End Of Year With Python Programming Language🍕🥂

This end-of-year python programming language article will teach you the python language from scratch. The tutorial will take you through the understanding of the Python programming language, help you deeply learn the concepts, and show you how to apply practical programming techniques to your specific challenges.

What you'll learn:

  1. A little theory on the python programming language
  2. How to set up Python on your machine
  3. What variables are in the python language

This particular article does not cover all the features of python. The article is intended to get you started with python programming. I will be writing more articles on other topics in the year 2022 hopefully. You can kindly grab a cup of coffee and journey with me.

WHAT IS PYTHON?

  1. High-level
    Python is a high-level programming language that makes it easy to learn. Python doesn’t require you to understand the details of the computer to develop programs efficiently.

  2. General-purpose
    Python is a general-purpose language. It means that you can use Python in various domains including:
    Web applications
    Big data applications
    Testing
    Automation
    Data science, machine learning, and AI
    Desktop software
    Mobile apps
    The targeted language like SQL can be used for querying data from relational databases.

  3. Interpreted
    Python is an interpreted language. To develop a Python program, you write Python code into a file called source code.
    To execute the source code, you need to convert it to the machine language that the computer can understand. And the Python interpreter turns the source code, line by line, once at a time, into the machine code when the Python program executes.
    Compiled languages like Java and C# use a compiler that compiles the whole source code before the program executes.

Next up ,
Setting up python on your machine

In this section, you will learn how to install python on your computer.
first of all, download the latest version of python from the official page. Python is available for windows, mac, and Linux operating systems. At this time of writing the article, the latest version of python is 3.10.1. Yours might differ depending on the time you are reading the article.

Image description

Second, double-click the installer file to launch the setup wizard.

Image description

*In progress
*

Image description

*Set up is done
*

Image description

Verify the installation
To verify the installation, you open the Run window and type cmd and press Enter:
Now type python in cmd and you should see the output like mine

Image description

If you see the output like the above screenshot, you’ve successfully installed Python on your computer. You can sip more coffee at this stage😍

You can also set up python on your favorite text editor such as vs code, sublime text and the likes. You can read this article to learn how to set up python on vs code

Now let is print something like hello world to the screen in python.
In cmd, type the following command and see fireworks

print("hello world")
Enter fullscreen mode Exit fullscreen mode

Image description

The print() is a built-in function that displays a message on the screen. In this example, it’ll show the message 'Hello, Word!'. hey wait, I just mentioned built-in function which might sound new to you right? Do not worry, functions are beyond the scope of this article and I will explain what functions are in python in future articles.

WHAT IS A VARIABLE IN PYTHON?
A variable is a named location used to store data in the memory. It is helpful to think of variables as a container that holds data that can be changed later in the program.
When you develop a program, you need to manage values, a lot of them. To store values, you use variables.

For example:

name = "Alex"
print(name)
Enter fullscreen mode Exit fullscreen mode

output:

Alex
Enter fullscreen mode Exit fullscreen mode

Here, we have created a variable called name and we have assigned a *value Alex * to the variable.
You can think of variables as a bag to store books in it and that book can be replaced at any time.
Now let is see how we can mutate or change the values

name = "Alex"
print(name)
name = "Dawood iddris"
print(name)
Enter fullscreen mode Exit fullscreen mode

expected output:

Alex
Dawood iddris
Enter fullscreen mode Exit fullscreen mode

In the above program, we have assigned Alex to the name variable initially. Then, the value is changed to Dawood iddris. Awesome right?

Variable Names
A variable can have a short name (like x and y) or a more descriptive name (age, carname, total_volume).

Rules for Python variables:

A variable name must start with a letter or the underscore character

  • A variable name cannot start with a number
  • A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
  • Variable names are case-sensitive (age, Age and AGE are three different variables)

In conclusion, we learned a little theory about python language, setting up python on the computer, printing hello world text to the screen and we concluded with variables.

Thank you for reading and do not forget to like and comment below and let me know what you think about the article.
Happy new year to you all. Meet you in 2022 for more articles from me.

Top comments (1)

Collapse
 
real_ib1 profile image
Ibrahim

That was brilliant