Run
# Given strings x = "Hello World!" y = "Hello User!" # N value n = 5 # Compare the first n characters if x[:n] == y[:n]: print(f'The first {n} characters are equal.') else: print(f'The first {n} characters are not equal.')
Output