Avatar ·

Exiting multiple loops

📁 List, Advanced Python Topics

There is an input list whose elements consist of some text. Need to check if the list elements contain words from one list and from another, and if there are words from one and not from the other, then output a message.
Can't figure out how to exit multiple loops after getting a result and move to the next element of the list

some_text = ['some text','another text','one more']whitelist = ['another','more']blacklist = ['some','else']for text in some_text:    for items in blacklist:        

                    
                
Avatar ·

The essence of the random_state parameter (in all functions and methods from SciKit-Learn) is reproducible random values. That is, if you explicitly set the random_state value to something other than None, the generated pseudo-random values will have the same values on each call.

Example:

In [1]: import numpy as npIn [2]: np.random.seed(31415)In [3]: np.random.randint(10, size=(5,5))Out[3]:array([[7, 3, 5, 
                            

Log in to leave an answer

Blogs