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!")
PythonMake sure you have Python installed and Python command is available for use in your terminal. Run the following command-
python hello.py
BashWe will get the output as below-
hello, world!
PlaintextLet’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)
PythonOutput:
Hello BigBoxCode
Value of a: 100
Value of b: 500
Sum of a and b is 600
Plaintext