Python program to print a sentence
In this python programs guide, we will learn to write:
-
python program to print a sentence
Python program to print a sentence
The code or python program to print a sentence is as follows:
# Owner : TutorialsInhand Author : Devjeet Roy
sentence = input("Enter a sentence: ")
print("Your sentence is:")
print(sentence)
The output of python program to print a sentence is:
PS C:\Users\DEVJEET\Desktop\tutorialsInHand> python code.py
Enter a sentence: I am a Developer
Your sentence is:
I am a Developer
Please check our video tutorial on write a program to print sentence in python:
Few important points on this program:
1. As discussed earlier, there is no main() method in Python. However you can make a use of one using the __name__ attribute.
2. In Python, we take user input using the input() function. The parameter to the input() function is the text which you want to get displayed in the console.
3. By default, print() function outputs a line in the console, starting from a new line always. However, you can make use of the same line using the end attribute.
Would you like to see your article here on tutorialsinhand.
Join
Write4Us program by tutorialsinhand.com
About the Author
Devjeet Roy
Full Stack Web Developer & Blockchain Enthusiast
Page Views :
Published Date :
Oct 31,2022