In Python, you can output variables using the print() function. You can combine strings and variables using the + operator, or use formatted strings for more complex output.
Python 3.6+ allows you to use f-strings for a more concise and readable way to format strings:
Python
name = "John"
age = 30
print(f"Hello, my name is {name} and I am {age} years old.")
# Output: Hello, my name is John and I am 30 years old.
Using format() method:
Python
name = "Alice"
age = 25
print("Name: {}, Age: {}".format(name, age))
# Output: Name: Alice, Age: 25
Output Variables
Python mein aap print() function ka use karke variables ka output dekh sakte hain. Aap strings aur variables ko + operator ke saath combine kar sakte hain, ya phir formatted strings ka use kar sakte hain taaki complex output ko aasani se manage kiya ja sake.