Jan-24-2018, 03:31 PM
Hi everyone.
2nd time poster so getting use to everything.
Here is what I got going on:
I am trying to create a list that looks like this:['a', 'b', 'c', ..., 'z'} so that I can then create a dictonary out of it.
I found a way to create that and the numbers 1-26
But I am running into issues with the rest of the code I have which looks like this
If I loop through I get an error about mistmatched types. If I loop through and try to convert those to a string (what is above) it also doesnt work.
If possible please explain this like you are talking to a 4 year old.
Thank you!
2nd time poster so getting use to everything.
Here is what I got going on:
I am trying to create a list that looks like this:['a', 'b', 'c', ..., 'z'} so that I can then create a dictonary out of it.
I found a way to create that and the numbers 1-26
mport string mylist = string.ascii_lowercase a = "'" b = "'" c = ", " for i in mylist: letters1 = a + i + b + c #print (letters1) #Create range of numbers for merging numbers = range(1,27)
But I am running into issues with the rest of the code I have which looks like this
#Create range of numbers for merging numbers = range(1,27) d = ":" for n in numbers: numbers1 = str(n) + d print (numbers1)I get an error when running the code and I can't seem to figure out how to get the numbers assigned to a list. If I just print numbers it says numbers = range (1,27) almost like it is treating it like a string instead of a function.
If I loop through I get an error about mistmatched types. If I loop through and try to convert those to a string (what is above) it also doesnt work.
If possible please explain this like you are talking to a 4 year old.
Thank you!