It appears it is still a string?
<class 'str'>
<class 'str'>
<class 'str'>
If I reverse x and y I get this error
values=[y] = x
TypeError: 'int' object is not iterable
I see I had errors in my code.
This code works.
import string what = input ("Please tell me the string you want to use: ") letter = input ("What is the letter you want me to find: ") values = {} a = what.find (letter) if a == -1: print ("not there") else: e = enumerate(what) for x, y in e: values=[x] = y print (type(values))<class 'str'>
<class 'str'>
<class 'str'>
<class 'str'>
If I reverse x and y I get this error
values=[y] = x
TypeError: 'int' object is not iterable
I see I had errors in my code.
This code works.
import string what = input ("Please tell me the string you want to use: ") letter = input ("What is the letter you want me to find: ") values = dict() a = what.find (letter) if a == -1: print ("not there") else: e = enumerate(what) for x, y in e: values[x] = y print (type(values))Thank you!