Raspberry Pi 3 Python code

Your First Python Code (Hello World)

This is a basic “Hello World!” code for python. and its a a traditional first program for most languages. You can test this out on your Raspberry Pi.

Python uses print() as its function of displaying or output whatever you place in the parentheses. The print() function is a built in function in Python and we will learn many more built in functions as we go along.

The “Hello World!” part of the code is know as a string and the sting is the argument sent to the function. Once you have placed the blow code in your editor, save the file as first.py.

Open your terminal and type python3 first.py and it should print out your string.

[sourcecode language=”python” wraplines=”false” collapse=”false”]
print "Hello World!"
[/sourcecode]

That’s it for now, there will be much more on python for the pi to come.

Questions or Comments

Your email address will not be published. Required fields are marked *