Python: Hello World

As a tradition here is the code for the “hello world” program in Python.

Create a file with any name you prefer. We are naming the file as “hello“. Then, the extension of the file should be “.py“. Now, add the following code to the file “hello.py“.

Add the following code to the file-

# hello.py

print("hello, world!")
Python

Make sure you have Python installed and Python command is available for use in your terminal. Run the following command-

python hello.py
Bash

We will get the output as below-

hello, world!
Plaintext

Let’s add some more code to the file-

print("Hello BigBoxCode")

# some comment here to describe the code

a = 100
b = 500

print("Value of a: ", a)
print("Value of b: ", b)

# Calculate sum
sum = a + b
print("Sum of a and b is ", sum)
Python

Output:

Hello BigBoxCode
Value of a:  100
Value of b:  500
Sum of a and b is  600
Plaintext

Leave a Comment


The reCAPTCHA verification period has expired. Please reload the page.