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.
Lessons in this chapter · Mastering the Basics
- 1. What is Programming?
- 2. What is Python and Why is it Popular?
- 3. Containers for Data, Variables
- 4. Data Types in Python
- 5. Operators for Performing Operations on Variables and Values
- 6. Fill-in-the-blank quiz
- 7. How to Talk to a Computer (Input and Output)
- 8. Various Ways to Output Values with the print Function
- 9. Escaping Special Characters
- 10. Converting Between Strings and Numbers
- 11. Reserved Words with Special Meaning, Keywords
- 12. What is Indentation and Why is it Important?
- 13. Multiple-choice quiz
- 14. Coding Quiz - Return Five Times the Given Number
Programming is the task of translating human language into a language that computers can understand.
Lecture
AI Tutor
Design
Upload
Notes
Favorites
Help