On Thu, 13 Jun 2013 17:26:18 +0300, Νικόλαος Κούρας wrote: > i just want 4 cases to examine so correct execute to be run: > > i'm reading and reading and reading this all over: > > if '-' not in ( name and month and year ): > > and i cant comprehend it.
Don't just read it. Open the interactive interpreter and test it. name = "abcd" month = "efgh" year = "ijkl" print(name and month and year) If you run that, you will see what the result of (name and month and year) is. Now, ask yourself: "k" in (name and month and year) True or false? Check your answer: print("k" in (name and month and year)) > While it seems so beautiful saying: > > if character '-' ain't contained in string name , neither in string > month neither in string year. > > But it just doesn't work like this. Correct. It doesn't work that way. > Since ( name and month and year ) are all truthy values, what is > returned by this expression to be checked if it cotnains '=' within it? Stop asking these questions. Try it for yourself and learn for yourself. You have a Python interactive interpreter. Try things, and see what they do. Read the documentation. THEN, and ONLY after you have done these things, should you ask for help. -- Steven -- http://mail.python.org/mailman/listinfo/python-list