Print Single and Multiple variable in Python Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report In Python, printing single and multiple variables refers to displaying the values stored in one or more variables using the print() function.Let's look at ways how we can print variables in Python:Printing a Single Variable in PythonThe simplest form of output is displaying the value of a single variable using the print() function.Example: Python x = 42 print(x) Output42 Explanation: x stores the value 42, and print(x) displays it on the console.Printing Multiple VariablesPython allows printing multiple variables in various ways. Let’s explore three common techniques: 1. Using Commas (default way) Python a = 10 b = 20 c = 30 print(a, b, c) Output10 20 30 Explanation: When variables are separated by commas, Python prints them with a space between each.2. Using f-strings (formatted string literals) Python name = "Prajjwal" age = 23 print(f"My name is {name} and I am {age} years old.") OutputMy name is Prajjwal and I am 23 years old. Explanation:f-strings are prefixed with the letter f before the opening quote.Inside the string, curly braces {} act as placeholders for variables or expressions.Python automatically replaces each {} with the value of the corresponding variable.Note: f-strings is compatible with latest Python versions (Python 3.6+).3. Using .format() Method Python lang = "Python" ver = 3 print("You are learning {} version {}.".format(lang, ver)) OutputYou are learning Python version 3. Explanation:In the string, the curly braces {} act as placeholders..format() method replaces the {} in the string in order with the values passed to it.Note: .format() is compatible with older Python versions and still widely used in legacy code.Also read: f-strings, print(). Comment K kartik Improve K kartik Improve Article Tags : Python Explore Python FundamentalsPython Introduction 2 min read Input and Output in Python 4 min read Python Variables 5 min read Python Operators 4 min read Python Keywords 2 min read Python Data Types 7 min read Conditional Statements in Python 3 min read Loops in Python - For, While and Nested Loops 5 min read Python Functions 5 min read Recursion in Python 4 min read Python Lambda Functions 5 min read Python Data StructuresPython String 5 min read Python Lists 4 min read Python Tuples 4 min read Python Dictionary 3 min read Python Sets 6 min read Python Arrays 7 min read List Comprehension in Python 4 min read Advanced PythonPython OOP Concepts 11 min read Python Exception Handling 5 min read File Handling in Python 4 min read Python Database Tutorial 4 min read Python MongoDB Tutorial 2 min read Python MySQL 9 min read Python Packages 10 min read Python Modules 7 min read Python DSA Libraries 15 min read List of Python GUI Library and Packages 3 min read Data Science with PythonNumPy Tutorial - Python Library 3 min read Pandas Tutorial 4 min read Matplotlib Tutorial 5 min read Python Seaborn Tutorial 15+ min read StatsModel Library- Tutorial 4 min read Learning Model Building in Scikit-learn 8 min read TensorFlow Tutorial 2 min read PyTorch Tutorial 6 min read Web Development with PythonFlask Tutorial 8 min read Django Tutorial | Learn Django Framework 7 min read Django ORM - Inserting, Updating & Deleting Data 4 min read Templating With Jinja2 in Flask 6 min read Django Templates 7 min read Python | Build a REST API using Flask 3 min read How to Create a basic API using Django Rest Framework ? 4 min read Python PracticePython Quiz 3 min read Python Coding Practice 1 min read Python Interview Questions and Answers 1 min read Like