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.
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': break else: print("You entered:",string,"\n")
Here is the sample run of the above python program to illustrates how to print string:
You may also like to learn or practice the same program in other popular programming languages: