...

/

Writing Our First Code

Writing Our First Code

Get familiar with using print statements, comments, and docstrings.

Let's get started with the fun stuff by diving directly into code.

The print() function

When learning any new programming language, a common tradition is to start by displaying the text "Hello, World!" on the screen. Each language has its own syntax for outputting or printing information. Python, known for its readability, makes this task simple by using the print() function.

Here’s how the print() function works in Python:

Press + to interact
print("Data to be printed")

All content to be printed is enclosed within the parentheses that follow the print keyword. Now, let’s attempt to print “Hello World” in the terminal.

Press + to interact
print("Hello World")

It's important to note that the text Hello World is ...