i have a program that converts text into morse code and then outputs it using a module i found in the snippets section but whenever i try to run it, it raises the error that "utext is not iterable"
here is the code:

print"Hello, what do you want to convert?"
for letter in utext:

At first sight, it seems that you forget to call lower() .

thanks that works great, i also have a problem that i dont know the cause of, whenever i run it, it plays the entire morse code before asking the question. i have checke beeps.py and it isnt coming from that, what could it be?

and unfortunately it only removed the error, it wont play them after i have entered the text

I suppose that the sound for "a" is played when beeps.a() is called. Your program plays all the letters when you fill your dict. What you could do is forget about the dict and write this

for letter in utext:
    if hasattr(beeps, letter):
        getattr(beeps, letter)()

Also, when you have a traceback, put the traceback in your posts. It's very useful for helpers.

Also you should check if there is something to put between the words in the morse code.

oh thanks, thats brilliant! i did a bit of looking around and i think that if you were to be using it in real life you would have the spaces and would use your intelligence to figure out where the would be :( but oh well, time to have some fun with this :D

i decided that i would expand it by adding in numbers but i cant really use

def 1():

can i? so i was wondering what i could do, considering i am using hassattr and getattr