I am relatively new to python and I have to create a program that prints the middle character of a user-inputted string. Here is what I have:
#accept string from user then print middle character
x = input("Enter a string: ")
print(x[len(x)/2-1])
However I keep getting this error when I try to run the program:
"TypeError: string indices must be integers".
Im not sure how to fix this or how to get this program to work. Please help!