Print is one of the most basic functions in Python and the basic command of Python that is used to print(display) messages and results of an action.
Python has no specific syntax that we have to follow, like other programming languages like C, C++, Java, etc. The pattern/Syntax to write using print command\function in Python is given below:Print ("Message", result)
It must be kept in view that the word print is a reserved word which means that you can not use it as a variable even if you tried it would give an error if not it will not execute the program however case limited means that you write in capitalized letters like Print or PRINT can be used as a variable name. This command tells the programming language that we have to print a result or message.
The bracket is used to tell the language, and starting and ending point of the print function.
" "helps to differentiate between whether you are printing a result or message while if you are doing both of the processes in a single command comma(, ) is used to tell the programming language that both result and message are preset in the single line command
Sample 1;
print("Hello World! ")
This sample shows the use of the print command to print any Result(such as value stored inside any variable or any constant). This Sample will help you to understand how we can use to tell the programming language, that it has a message or result to print, and how we can differentiate between them.
For this very reason we will use a comma(, ) to separate the message from the result (Variable and Constant). As shown
print ("Value of a is: ", a)
Output
The value of a is: 10
If you have any type of issue or request leave an comment so that we can handle it