Run
# Input string x = "Hello, World!" # Number of characters to retrieve n = 4 # Get the first n characters first_n_characters = x[:n] # Print the result print(first_n_characters)
Output