What will be the output of the given Python statement : print("7"+"7")
1 point
14
7
error
77
Answers
Predicting output - Python
Before we predict the output of the given Program, let's first know about that what is Python and what is programming.
What is Python?
Python is a powerful high-level, object-oriented programming language. It was created by Guido van Rossum. It was launched on 1991. It can connect to the database system, it can also read and modify files. Python works on different platforms like, Raspberry Pi, Linux, Mac, Windows and many more platforms.
What is Programming?
Programming means to create or develop a software which is called a program that contains the instructions to tell a computer what to do.
The Output
The output of the given python program will be as follows:
>>> 77
This is something called concatenation, which can be done on any two strings.
Concatenation: It is the addition of two or more strings. For example:
>>> print("Empire" + "Warrior")
Then the output of the given program will be as follows:
>>> EmpireWarrior
And it even works with numbers also. Strings containing numbers are still added as strings rather than integers. For example:
>>> print("5" + "5")
Then the output of the given program will be as follows:
>>> 55
Remark: Don't try to add a string with a number, by doing this, it will produce an error.
Now, I think I explained everything about Concatenation in Python and also I predict the output. We use Python for web development, mobile application, video games, machine learning and AI.
Predicting output - Python
Before we predict the output of the given Program, let's first know about that what is Python and what is programming.
What is Python ?
Python is a powerful high-level, object-oriented programming language. It was created by Guido van Rossum. It was launched on 1991. It can connect to the database system, it can also read and modify files. Python works on different platforms like, Raspberry Pi, Linux, Mac, Windows and many more platforms.
What is Programming ?
Programming means to create or develop a software which is called a program that contains the instructions to tell a computer what to do.
\rule{80mm}{1pt}%
The Output
The output of the given python program will be as follows:
>>> 77
This is something called concatenation, which can be done on any two strings.
Concatenations: It is the addition of two or more strings. For example:
>>> print("Empire" + "Warrior")
Then the output of the given program will be as follows:
>>> EmpireWarrior
And it even works with numbers also. Strings containing numbers are still added as strings rather than integers. For example:
>>> print("5" + "5")
Then the output of the given program will be as follows:
>>> 55
Remark : Don't try to add a string with a number, by doing this, it will produce an error.
Now, I think I explained everything about Concatenation in Python and also I predict the output. We use Python for web development, mobile application, video games, machine learning and AI.