(Jan-25-2018, 05:48 PM)j.crater Wrote: The thing is dictfunc() function will not be very helpful because it does not return anything.
Really? Because if I print letlist it returns values. So I am just trying to get letlist into that function. That is initially why I tried using global because I didn't realize you could pass functions to other values.
Here is the output if I add a print for letlist:
{0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f', 6: 'g', 7: 'h', 8: 'i', 9: 'j', 10: 'k', 11: 'l', 12: 'm', 13: 'n', 14: 'o', 15: 'p', 16: 'q', 17: 'r', 18: 's', 19: 't', 20: 'u', 21: 'v', 22: 'w', 23: 'x', 24: 'y', 25: 'z'}
import string def dictfunc(): letlist = dict(enumerate(string.ascii_lowercase)) print (letlist) dictfunc()