Python Program to Print String

« Previous Program Next Program »

Print String in Python

To print string in python, you have to ask from user to enter a string and print it back on the output screen using the print() statement as shown in the program given below.

Python Programming Code to Print String

Following python program ask from the user to enter the string to print that string as output of the program:

# Python Program - Print String
while True:
	print("Enter 'x' for exit.")
	string = input("Enter string: ")
	if string == 'x':
		print("You entered:",string,"\n")

Here is the sample run of the above python program to illustrates how to print string:

python print string

Same Program in Other Languages

You may also like to learn or practice the same program in other popular programming languages:

« Previous Program Next Program »


Quick Links
Signup - Login - Give Online Test