🪸Different ways to use print() in Python🐍
There are different ways to use print() in Python and you should use that best suits you😎

👋 Hi, I’m @HitenDewangan 👀 I enjoy coding, music, graphic designing and martial arts. 🧩 Intermediate coder in Python. 🪸 Learnt Fundamentals of C and Data Analysis with MS Excel. 🌱 I’m currently learning Web Development, and Data Science with Python(Panda). 💞️ I’m looking to collaborate on projects. 📫 How to reach me : Email: hitendewangan100j@gmail.com
When I was new to coding, late in 2022's, I use only 2 or 3 types of print()...But now, I got to know so many new ways to use print()...
Do you want to know these methods ???
✌🏻Let's have a glimpse on these methods :
Simple Print:
print("Hello, World!")Print with Variables:
name = "John" age = 25 print("Name:", name, "Age:", age)Formatted String Literal (f-string):
name = "Alice" age = 30 print(f"Name: {name}, Age: {age}")String Concatenation:
name = "Bob" age = 22 print("Name: " + name + ", Age: " + str(age))Multiple Arguments in
print:name = "Charlie" age = 28 print("Name:", name, end=", ") print("Age:", age)Using
formatmethod: name = "Eve" age = 35 print("Name: {}, Age: {}".format(name, age))Using
joinwith a Separator:codefruits = ["apple", "banana", "orange"] print(", ".join(fruits))Printing on the Same Line:
print("Hello", end=" ") print("World!")




