- Get link
- X
- Other Apps
Hello Pythonistas!
Hope you are doing well. In this python tutorial, we are going to learn how to join two strings into one single string. This is a very basic concept of python. So let's get started. If you have any questions about this tutorial then you can comment below.
The Whole Code --
last_name = input("Enter your last name: ")name = first_name + last_name
print("Your full name is: ", name)
first_name = input("Enter your first name: ")
Step-1: Create a Python File
So first of all, you have to create a python file.
Step-2: Take input from the user
first_name = input("Enter your first name: ")
last_name = input("Enter your last name: ")
In the above code, we are taking two inputs from the user. One for first name & another for the last name.
Step-3: Adding the two strings
name = first_name + last_name
In the above code, we are adding the two strings and storing them in the "name" variable. We are adding the two variables using the "+" operator.
Step-4: Printing the Output
print("Your full name is: ", name)
In the above code, we are printing the name variable. That means the full name.
Congratulations now you know how to join two strings into one single string. If you have any questions then you can write them in the comments or mail me- arefinanwar112@gmail.com.
Join Facebook group -https://www.facebook.com/Python-Programming-106878491339183
python,python strings,python tutorial,string concatenation in python,python string,learn python,strings in python,python 3,strings,python programming,python for beginners,python string slicing,joining strings in python,python string concatenation,python tutorial for beginners,python strings tutorial,python string methods,python string tutorial,string,python 3 strings,python programming strings,python basics,how to join strings in python,how to join strings in python 3,python string formatting
Comments
Post a Comment