To copy string in python, you have to ask from user to enter a string and then copy that string into another string variable and finally print the value of that string variable as shown in the program given here.
Following python program ask from user to enter a string to copy that string:
# Python Program - Copy String while True: print("Enter 'x' for exit.") string = input("Enter any string: ") if string == 'x': break else: print("Copying string1 into string2...") cstring = string print("String 2 after successfully copied..!!") print(cstring,"\n")
Here is the sample run of the above Python program illustrating how to copy string:
You may also like to learn or practice the same program in other popular programming languages: