Instagram
youtube
Facebook
Twitter

Copy One String to Another in Python

A simple Python program to copy one string to another.
Code Explanation in Points:

 

  • original = input("Enter the original string: ")
     
    • Takes input from the user.
       
    • Stores the input in the variable original.
       
  • copied = original
     
    • Assigns the value of original to a new variable copied.
       
    • This creates a copy of the original string.
       
  • print("Copied string:", copied)
     
    • Prints the copied string on the screen.

Program:

original = input("Enter the original string: ")
copied = original
print("Copied string:", copied)