Technical Roadmap

How to take output in python

Providing Output: The print() Function

To display information on the screen, we use the print() function. You can pass strings, numbers, or variables inside it. By default, the print() function adds a new line after the output.

Python (Output)
# Basic Print
print("Welcome to Logicoria!")

# Multiple Values (Comma separated)
print("Total Articles in Logicoria:", 100)

# Custom Separator
print("01", "01", "2026", sep="-")
Output:
Welcome to Logicoria!
Total Articles in Logicoria: 100
01-01-2026
💡 The Logicoria Tip

Always provide a clear prompt inside the input("Enter your name: "). This prevents the user from staring at a blank screen and helps them provide the correct information!

Advanced Output: String Formatting (f-strings)

F-strings provide a modern and efficient way to embed variables directly inside a string by placing an f before the opening quotation mark and using curly brackets {}.

Python (F-Strings)
name = "Logicoria"
articles = 100

# The F-String way
print(f"{name} has {articles} articles")
Output:
Logicoria has 100 articles