union in Python

Jørgen Cederberg jorgencederberg at hotmail.com
Wed Aug 13 08:29:14 CEST 2003

Wiebke Pätzold wrote:

Hello Wiebke

you did what I asked, but you forgot to read to whole message I wrote to 

> This is the error-traceback that is print whenmy program failed:
>>>>  Themenbereiche Nachname
> Traceback (most recent call last):
>   File
> "C:\PROGRA~1\Python22\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
> line 310, in RunScript
>     exec codeObject in __main__.__dict__
>   File
> "C:\Programme\Python22\Lib\site-packages\Pythonwin\pywin\Demos\Uebung11.py",
> line 46, in ?
>     print feld_th, feld_na, union1(feld_th, feld_na)
> NameError: name 'union1' is not defined

The following is taken from my previous message to you:
> Where are the functions union1 and union2 defined and why do you want to find the union between two strings, it doesn't make sense. On the other hand, if feld_th and feld_na where two lists it would make sense.

And this is exactly what caused the error. The last line of your 
traceback states the problem: > NameError: name 'union1' is not defined
You should really read the tracebacks carefully, they tell what went 
wrong and where it went wrong.

You probably made the functions somewhere else, but I still don't see 
the point in taking the union of two strings.

Do you care to explain how the functions work or how you intend to get 
them working or do just want a solution to your assigment?


Ps.. You should really do your self a favour and download the 
documentation: http://www.python.org/doc/current/download.html
Read the tutorial carefully and try to do some the examples in it.

More information about the Python-list mailing list