Generate a code snippet in Python that takes a user-inputted string and creates and prints a dictionary with keys that are the indices of the characters in the string.
Not applicable
user_string = input('Enter a string: ')
char_dict = {i:char for i, char in enumerate(user_string)}
print(char_dict)