- The normal print statement.
value = 100
print(value)
# output
# 100
- Using the Format keyword inside the print statement
name = "Kalidas"
age = 21
print("Name of Student: {}\nAge of Student: {}".format(name,age))
'''
Output
Name of Student: Kalidas
Age of Student: 21
'''
- Using f-strings (Python 3.6+):
name = "John"
age = 30
print(f"Name: {name}, Age: {age}")
'''
Output
Name: Jhon, Age: 30
'''
So these are the main python print methods I use for various use cases but there are still more , the "end" and sep paramtere which will be discussed later in another article.