لَآ إِلَـٰهَ إِلَّا هُوَ
LA ILAHA ILLA HU
Allah, Your Lord There Is No Deity Except Him.

Lesson 4: Concatenation In Python Coding

Concatenation in Python coding means adding strings together.

For Example; If you are asking the user for his name as input and in the next line you want to print his name with greeting.

You will have to write the code in a manner that resultant output displays his name with the greeting.

Python Code For Concatenation


output will be

Hello + what is ur name?

About This Code

Note that in the 1st line of code you define a variable which is ""name".

In the second line of code you are asking the system to print name with Hello.

If in the first line of code you do not define the variable as name than when output will be displayed the user will write his name but it will not be saved, as a result there will be no action.

Once you have define the variable correctly the output will be Hello + name

When You type or copy paste the above code in Python IDLE/Online Compiler/Editor, You will get the following output.

Hello + what is ur name?(any name entered by the user.

You can type/copy paste the above code in any online compiler or editor or you can even practice to write the code by hand.