Write a Program to Print Python is Fun

In this article let's learn how to write a Python program to print a  string that is “python is fun”.

Let's declare a string variable and assign “python is fun” string to it.

 

Write a Program to Print Python is Fun

 

 


Write a Program to Print Python is Fun

Let's take a string variable that is fun and assign a string to it. The string python is fun.  now using the print function call let's print the print  by passing the string variable as the input argument to the Python function

This will print out the string to the standard output console.

fun = "Python is Fun"
print(fun)




Code
==============

fun = "Python is Fun"
print(fun)





There is another way to print Python that is fun : just use the print statement and use the string by declaring it in  double quotes  as shown below.

Code
===================
print("Python is Fun")




Output
=================
> python main.py
Python is Fun




Conclusion
===============
Execute the above python code to print the string "Python is Fun". Comment it down below if you have any suggestion to improve the above python program.






Post a Comment

0 Comments