# Compare first N and last N characters m = input() n = int(input()) first = m[:n] last = m[-n:] res first!=last print(res)
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
python
# Compare first N and last N characters m = input("Enter a string: ") n = int(input("Enter the number of characters to compare: ")) first = m[:n] last = m[-n:] res = first != last print(res)
line 4, in <module> n = int(input("Enter the number of characters to compare: ")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''