# Nakafa Framework: LLM
URL: /en/subject/university/bachelor/ai-ds/ai-programming/print-function
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/subject/university/bachelor/ai-ds/ai-programming/print-function/en.mdx
Output docs content for large language models.
---
export const metadata = {
    title: "Print Function",
    description: "Learn Python print function for displaying output. Master sep, end parameters and formatting techniques for precise output control.",
    authors: [{ name: "Nabil Akbarazzima Fatih" }],
    date: "09/17/2025",
    subject: "AI Programming",
};
## Introduction to Print Function
The `print()` function is one of the most frequently used built-in Python functions for displaying output to the screen. Imagine the print function like a loudspeaker that announces information to everyone. Every time you want to show calculation results, messages, or data to users, the print function becomes a communication bridge between the program and humans.
The print function belongs to the built-in function category, just like `len()`, `abs()`, and `round()`. This means you don't need to import additional modules to use it.
## Basic Print Function Syntax
The complete print function syntax has several parameters that can be customized to control how output is displayed.
The `*objects` parameter allows the print function to accept unlimited number of arguments. Each argument will be separated by the character specified by the `sep` parameter.
## Separator Parameter (sep)
The `sep` parameter determines the character or string used to separate multiple objects in a single print call. The default value of `sep` is a single space.
Using the right separator can make output more readable and match the desired format.
## End Parameter
The `end` parameter determines the character or string added at the end of output. The default value of `end` is newline (`\n`), which causes each print call to create a new line.
Changing the `end` parameter is very useful when you want to combine output from multiple print calls on one line or provide special formatting.
## Displaying Various Data Types
The print function can display various Python data types automatically. Python will convert each object to its string representation before displaying it.
The ability of print to handle various data types makes it very flexible for debugging and displaying program information.
## Output Formatting Techniques
### Print with F-String
F-string is a modern and efficient way to format output in Python. This technique allows direct variable insertion within strings.
= 70 else "Fail"
print(f"Score: {score}, Status: {status}")
# F-string with number formatting
pi = 3.14159265359
print(f"Pi with 2 decimals: {pi:.2f}")
print(f"Pi with 4 decimals: {pi:.4f}")
print(f"Pi as percentage: {pi:.1%}")`
    }
  ]}
/>
F-string provides a very readable and efficient way to combine text with variables or calculation results.
### Print Without Newline
When you want to display output on one line gradually, the `end` parameter can be changed to avoid automatic newlines.
This technique is very useful for creating interactive interfaces or displaying progress from time-consuming operations.