Print Hello World in Python
This Program “Print Hello World in Python” is a very basic program. It is basically used to demonstrate the print() function of Python. This program shows that how can we print a string in Python.
What is print() function in Python?
print() function is an inbuilt function in python. This function is used to display/print a message (string) on the screen.
Syntax of print() function
print(value(s), sep=separator, end='\n')
Parameters of print() function
- value(s) : Any number of values or objects. All values will be converted into string before printing.
- sep = ‘separator’ : This is an optional parameter. It specifies how to separate more than one string.
- end = “\n” : It is also an optional parameter. This parameter is used to print at the end of the string.
Program to print “Hello World” in Python.
![print hello world in python](https://i0.wp.com/csiplearninghub.com/wp-content/uploads/2022/06/print-hello-world-in-python.jpg?resize=574%2C171&ssl=1)
Output of Program
![print hello world in python output](https://i0.wp.com/csiplearninghub.com/wp-content/uploads/2022/06/print-hello-world-in-python-output.jpg?resize=348%2C212&ssl=1)
More Examples of print() function
![print hello world in python examples](https://i0.wp.com/csiplearninghub.com/wp-content/uploads/2022/06/print-hello-world-in-python-examples.jpg?resize=534%2C178&ssl=1)
OUTPUT of above print statements
![](https://i0.wp.com/csiplearninghub.com/wp-content/uploads/2022/06/print-hello-world-in-python-examples-output.jpg?resize=398%2C183&ssl=1)
Explanation of above print statements
- First print statement is printing two strings separated by comma(,)
- Second print statement is showing the use of ‘sep’ parameter of print() function.
- Third print statement is showing the use of ‘\n’. It is used to bring the string(after the ‘\n’) in the next line.
- Fourth statement is showing the use of ‘end’ parameter of print() function.
MCQ of Computer Science Chapter Wise
2. Flow of Control (Loop and Conditional statement)
3. 140+ MCQ on Introduction to Python
4. 120 MCQ on String in Python
7. 100+ MCQ on Flow of Control in Python
8. 60+ MCQ on Dictionary in Python
Important Links
100 Practice Questions on Python Fundamentals
120+ MySQL Practice Questions
90+ Practice Questions on List
50+ Output based Practice Questions
100 Practice Questions on String
70 Practice Questions on Loops
70 Practice Questions on if-else
Disclaimer : I tried to give you the correct coding of ” Print Hello World in Python” , but if you feel that there is/are mistakes in the code or explanation of “Print Hello World in Python “ given above, you can directly contact me at csiplearninghub@gmail.com.