Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 15 Online
OpenStudy (anonymous):

hey everyone... could anyone tell me how to assert that the input polynomial has atleast one real root in problem set 2..also how do i assert that the elements of the tuple are not of string type.??

OpenStudy (anonymous):

Don't know how you could assert that the function has a real root without checking it - maybe best to document this restriction in a docstring here is an expression that will return false if the tuple has a string in it http://dpaste.com/763895/

OpenStudy (anonymous):

or True not in map(lambda k: isinstance(k, str), x)

OpenStudy (anonymous):

Thanks! yeah maybe it is better to put the restriction in doc string

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!