What is print statement ?
In Python, the "print" statement is a built-in function that is used to display text or variables on the screen or console. It is a basic but essential tool in Python programming. To use the print statement, you simply type the word "print" followed by the text or variable you want to display.
Examples:
1). If you want to display the text "Hello, world!", in python console.
print("Hello world")
2). If you want to display the value of a variable, in python console:
a = 184
print(a)
print(a)
3). You can also display multiple items at once by separating them with commas
name = "Arsalan"
last_name = "Khatri"
print("First name is ",name,"Last name is ",last_name)
print("First name is ",name,"Last name is ",last_name)
4). You can also use the print statement for formatting output.
x=10
y=20
print(f"Value of x is {x} and Value of y is {y}")
y=20
print(f"Value of x is {x} and Value of y is {y}")
LIKE | SHARE | SUBSCRIBE