For a class I am learning how to slice integers. In the code below the variable halflength is equal to half of the length of the variable message.
new = message[halflength::]
halflength is equal to an integer, however whenever I run this code I get this error:
TypeError: slice indices must be integers or None or have an
__index__method
Basically I need to try and create a new string that is equal to the second half of the original string.
Example: original string 1234 would produce 34 as the new string.
halflength. It does not seem to be an integer.