Skip to main content

Python print() Function

When you start learning Python, one of the first things you need to learn is how to display information on the screen. For example, you might want to display: A welcome message. Your name and age. The result of a mathematical calculation. Student marks and results. Information generated by a Python program. Python provides a built-in function called print() for displaying information. The print() function is one of the simplest and most frequently used functions in Python. It helps programmers display information while testing programs, solving problems, and developing applications. In this article, we will learn how to use print() with practical examples and their outputs. 1. What Is the print() Function in Python? The print() function is a built-in Python function that displays information in the output area, usually the terminal or console. Let's look at a simple example. print("Hello, World!") Output: Hello, World! In this example, Python displays the text Hello,...

What Is a Computer?

Computers are everywhere today. We use computers for studying, working, communicating, entertainment, banking, shopping, programming, artificial intelligence, and many other activities.

But what exactly is a computer? How does it work? What makes a computer different from other electronic devices?

If you are beginning your journey into Python, programming, artificial intelligence, or computer science, understanding the basics of computers is an important first step.

In this article, we will learn what a computer is, how it works, its major components, and why understanding computers is important before learning programming.


What Is a Computer?

A computer is an electronic device that accepts data as input, processes that data according to a set of instructions, produces an output, and can store information for future use.

In simple words:

Input → Processing → Output

For example, suppose you use a calculator to add two numbers:

  • You enter 10 and 20 → Input

  • The computer calculates 10 + 20 → Processing

  • The result 30 is displayed → Output

This basic process is found in almost every computer system.


How Does a Computer Work?

A computer generally works through four basic stages:

1. Input

Input is the data or instructions provided to a computer.

Examples include:

  • Typing using a keyboard

  • Clicking a mouse

  • Touching a touchscreen

  • Speaking through a microphone

  • Scanning a document

  • Capturing an image using a camera

For example, when you type your name into a program, your name becomes input.


2. Processing

After receiving input, the computer processes the information.

The CPU (Central Processing Unit) performs many of the calculations and logical operations required by programs.

For example:

If you enter:

25 + 15

the computer processes the two numbers and performs the addition operation.


3. Output

The processed information is presented to the user as output.

Common output devices include:

  • Monitor

  • Printer

  • Speakers

  • Projector

For example, when a calculator displays 40, that displayed result is the output.


4. Storage

Computers can also store data so that it can be used later.

Examples of storage devices include:

  • Hard disk drives

  • SSDs

  • USB drives

  • Memory cards

For example, when you save a Python program on your computer, the program is stored for future use.


Main Components of a Computer

A computer system consists of different components that work together.

The two broad categories are:

  1. Hardware

  2. Software

Understanding these two concepts is essential before learning programming.


What Is Hardware?

Hardware refers to the physical components of a computer that we can see and touch.

Examples include:

  • Keyboard

  • Mouse

  • Monitor

  • CPU

  • RAM

  • SSD

  • Hard disk

  • Motherboard

  • Printer

For example, when you use a keyboard to type a Python program, the keyboard is hardware.


What Is Software?

Software is a collection of programs and instructions that tells a computer what to do.

Unlike hardware, software cannot normally be physically touched.

Examples of software include:

  • Windows

  • Linux

  • macOS

  • Microsoft Word

  • Web browsers

  • Python

  • Mobile applications

  • Games

A computer needs software to perform useful tasks.


Hardware vs Software

The difference can be understood easily:

HardwareSoftware
Physical componentCollection of programs/instructions
Can be touchedCannot normally be touched
Examples: keyboard, RAM, monitorExamples: Windows, Python, browser
Requires software to perform useful tasksRequires hardware to run

Hardware and software work together to make a computer system useful.


What Is an Operating System?

An Operating System (OS) is system software that manages computer hardware and provides an environment for applications to run.

Popular operating systems include:

  • Windows

  • Linux

  • macOS

  • Android

  • iOS

For example, when you open a Python program on your computer, the operating system helps manage the resources required to run that program.

The operating system also manages things such as:

  • Files

  • Memory

  • Hardware devices

  • Applications

  • User interaction

  • System resources


What Is a Program?

A program is a set of instructions written to make a computer perform a particular task.

For example, a calculator application contains instructions for:

  • Addition

  • Subtraction

  • Multiplication

  • Division

Similarly, a Python program contains instructions written using the Python programming language.

A simple Python program can look like this:

print("Hello, World!")

This instruction tells Python to display:

Hello, World!

What Is Programming?

Programming is the process of creating instructions that tell a computer how to perform a task or solve a problem.

A person who writes computer programs is called a programmer or software developer.

For example, suppose we want a computer to calculate the area of a rectangle.

We need to:

  1. Get the length.

  2. Get the width.

  3. Multiply length by width.

  4. Display the result.

These instructions can then be converted into a programming language such as Python.


What Are Programming Languages?

Humans communicate using natural languages such as English, Hindi, Bengali, and many others.

Computers, however, need instructions in a form they can process.

Programming languages allow humans to write instructions that can be translated or interpreted so that computers can execute them.

Examples of programming languages include:

  • Python

  • Java

  • C

  • C++

  • JavaScript

  • C#

  • PHP

  • Go

  • Rust

Each programming language has its own syntax and features.


What Is Python?

Python is a high-level, general-purpose programming language known for its relatively simple and readable syntax.

Python is widely used in areas such as:

  • Web development

  • Automation

  • Data analysis

  • Data science

  • Machine learning

  • Artificial intelligence

  • Scientific computing

  • Software development

Python is especially popular among beginners because its syntax is generally easier to read compared with many other programming languages.

In this course series, Python will eventually be used for programming, data science, machine learning, artificial intelligence, generative AI, and AI application development.

The course syllabus introduces Python after the basic concepts of computers and programming.


Why Should You Learn Computer Basics Before Python?

You might wonder:

“If I want to learn Python, why do I need to learn about computers first?”

Understanding the fundamentals makes programming concepts easier to understand.

For example, when learning Python, you will encounter concepts such as:

  • Programs

  • Software

  • Memory

  • Files

  • Operating systems

  • Input and output

  • Processing

  • Programming languages

Knowing the basics beforehand helps you understand what happens when your Python code runs.


Computer → Programming → Python → AI

If your goal is to eventually learn Artificial Intelligence, you can think of the learning journey like this:

Computer Fundamentals

↓

Programming Fundamentals

↓

Python

↓

Core Python

↓

Data Science

↓

Mathematics & Statistics

↓

Artificial Intelligence

↓

Machine Learning

↓

Deep Learning

↓

NLP & Computer Vision

↓

Generative AI & LLMs

↓

AI Applications

This is also consistent with the progression of the uploaded two-year syllabus, which starts with programming and Python fundamentals and later moves through data science, mathematics, AI, machine learning, deep learning, NLP, computer vision, generative AI, LLM applications, RAG, agents, deployment, and projects.


Real-Life Examples of Computers

Computers are not limited to desktop PCs and laptops.

Examples include:

  • Smartphones

  • ATMs

  • Smart TVs

  • Cars

  • Smart watches

  • Medical equipment

  • Gaming consoles

  • Servers

  • Industrial machines

Many modern devices contain computer systems that process information and perform specific tasks.


Key Takeaways

Let's summarize what we learned:

  • A computer is an electronic device that accepts input, processes data, produces output, and can store information.

  • Hardware refers to physical computer components.

  • Software consists of programs and instructions.

  • An operating system manages computer resources and provides an environment for applications.

  • A program is a set of instructions for performing a task.

  • Programming is the process of creating instructions for computers.

  • Programming languages allow developers to write computer instructions.

  • Python is a high-level, general-purpose programming language.

  • Understanding computer fundamentals provides a foundation for learning programming and Python.

Comments

Popular posts from this blog

Understanding Comments in Java: A Beginner’s Guide

When learning Java programming, one of the first concepts you’ll come across is comments . Comments may not affect how a program runs, but they play a crucial role in making code more understandable, readable, and maintainable. Let’s dive deeper into what comments are, why they’re important, and the different types of comments in Java. What are Comments in Java? A comment in Java is a piece of text written within a program that is ignored by the compiler . In other words, comments are notes for humans, not instructions for machines. They help developers explain the purpose of code, describe logic, or temporarily disable certain lines of code without deleting them. Why are Comments Important? 📌 Readability – Comments make code easier to understand for you and others. 📌 Maintenance – When you revisit your code after months, comments remind you what you were doing. 📌 Collaboration – In team projects, comments explain code to fellow developers. 📌 Debugging – You c...

Java Program to Check Voting Eligibility

In this program, we’ll take the user’s age as input and check whether the person is eligible to vote or not. In India, the minimum age required to vote is 18 years . 💻 Program Code // Java Program to Check Voting Eligibility import java.util.Scanner; public class VotingEligibility { public static void main(String[] args) { // Create Scanner object to take input from user Scanner sc = new Scanner(System.in); // Ask user to enter age System.out.print("Enter your age: "); int age = sc.nextInt(); // Check eligibility if (age >= 18) { System.out.println("You are eligible to vote."); } else { System.out.println("You are not eligible to vote yet."); System.out.println("You can vote after " + (18 - age) + " year(s)."); } sc.close(); // Close the scanner } } 🧠 Explanation import java.util.Scanner; → Imp...

Java Program to Calculate Total Marks and Average of Five Subjects

💡 Program Explanation In this program: The user will input marks of five subjects . The program will calculate the total marks and average . It will then display both results clearly. 🧑‍💻 Java Code: // Java Program to Calculate Total Marks and Average of Five Subjects import java.util.Scanner; // Importing Scanner class for user input public class TotalAndAverage { public static void main(String[] args) { // Creating Scanner object to take input from user Scanner sc = new Scanner(System.in); // Declaring variables for five subjects double subject1, subject2, subject3, subject4, subject5; // Taking marks input for each subject System.out.print("Enter marks of Subject 1: "); subject1 = sc.nextDouble(); System.out.print("Enter marks of Subject 2: "); subject2 = sc.nextDouble(); System.out.print("Enter marks of Subject 3: "); subject3 = sc.nextDo...