Python for Absolute Beginners [Part-1]

Blogs

Written by:

In this article we learn about python for absolute beginners. Although it is said that python is very easy programming language, it is not the programming language that you should focus on but the concepts altogether.

In this journey we will learn everything by implementing everything practically. It is going to be a long journey so be patient, Rome wasn’t built in a day.

Let’s start : Python for Absolute Beginners,

I am assuming you have already installed python and an IDE.

Variables are the fundamentals of every programming language. Let’s see how to us them in python.

python_variable

Here, x is the name of variable and 5 is the assigned value of the variable.

We added another variable y but this time instead of an ‘int’ value we assigned a string. You can also add any number of print statements as you want and it print in the same order as you wrote. The output of the above code is as follows-

Sweet isn’t it??

Change Data Type : Python for Absolute Beginners

We can also change the data type of the variables into int, float or string which are the data types in python.

And the output will be,

Also, by using ‘#’ symbol we can comment any statement in the python which will not be counted as a part of the program at the time of execution.

If you don’t know the type of data your variable holds don’t worry, using type() function in print you find this as well.

Output,

Warning!!

Python is a case-sensitive language which means it will treat ‘a’ and ‘A’ as two different names. So, be careful while naming.

Output,

Another cool way of making and print variables are as follows.

Output,

See how easy is it to make a variable!!!!!!!!!!!!!

Now let’s talk about some rules to create variable. You won’t need it at all but it’s better to know an avoid errors.

  • A variable name must start with a letter or the underscore character
  • 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)

This was just to get you started in the world of programming. In the next part of python for absolute beginners we will start writing proper codes.

For more latest Updates, follow us TwitterFacebook and Linkedin.

Like to Read

Leave a Reply

%d bloggers like this: