What is Programming?
Programming is like telling a computer, "Perform this task in this way!"
.
Computers are powerful machines, but they do not understand human languages like English or Spanish.
Programming is the process of converting human language, which consists of letters and words, into a language that computers—which only understand 0s and 1s—can process and execute.
What Does the Term "Program" Mean?
Computers do not think for themselves; they simply execute commands exactly as they are given.
To make a computer perform specific tasks, we must write clear and precise instructions
.
A program is a set of these instructions that follow a structured procedure to tell the computer what to do.
What is Inside a Computer Program?
A computer program consists of code
, which provides instructions to the computer.
Each instruction in the code performs a specific task, and together, these instructions form a complete program that executes a particular function.
The example below instructs the computer to display "Hello, World!"
on the screen.
# Display the sentence "Hello, World!" on the screen
message = "Hello, World!"
print(message)
In Python, to display the result of the tasks performed by the program on the screen, you use the print()
function, placing the value you want to print inside the parentheses ( )
.
Notes
-
Calling specific functions using parentheses is known as a
Function call
, andprint()
is one of the built-in functions provided by Python. -
The parts starting with
#
are called comments, and they do not affect the execution of the program. Comments are used to explain the code or add necessary information.