#2 Python Print Function

Previous post: https://codinghelp.site/wiki/python/installing-python-pycharm/

Next post: https://codinghelp.site/wiki/python/3-python-input-function/

The Print Function

In python, to send a message to the console we use something called “ print() “. In the parentheses we pass in what would we like to print.

The Print Function Syntax

This is how we would print Hello World in the console. The quotes are a declaration of “text” (python name for this: string). We can use double quoted (“) and single quoted (‘) quotes in the print function.

Example

This would print Hey!! to the console. Simple as that.

Exercise

Make a script that prints Hey! How are you? to the console.

Answer Key

image