Home > other >  Python is how to judge Chinese string in another string in Chinese (no order)
Python is how to judge Chinese string in another string in Chinese (no order)

Time:10-12

CodePudding user response:

 a='hello' 
B='good bye bye you

Def func (a, b) :
Return the set (the list (a)). Issubset (set (the list (b)))

Print (func (a, b))

CodePudding user response:



reference 1/f, happy pigs response:
 a='hello' 
B='good bye bye you

Def func (a, b) :
Return the set (the list (a)). Issubset (set (the list (b)))

Print (func (a, b))

Thanks for a great god

CodePudding user response:

Directly with members of the test is not just a matter of,

> A='hello'
> B='good bye bye you
> A in b
False
> C='no hello lonely'
> A in c
True

CodePudding user response:

The
reference 3 floor DuskCrow_ response:
directly with members of the test is not just a matter of,

> A='hello'
> B='good bye bye you
> A in b
False
> C='no hello lonely'
> A in c
True

Members of the test in with the requirements of the order

CodePudding user response:

In disorder, is to test a single text, or test Chinese string
Use the collection may be the emphasis in the Chinese to filter,
For example:
> Def func (a, b) :
. Return the set (the list (a)). Issubset (set (the list (b)))
.
> A='round'
> B='there is a comb on the old round table'
> Func (a, b)
True

CodePudding user response:

reference 5 floor DuskCrow_ reply:
disorderly, is testing in a single word, or testing Chinese string
Use the collection may be the emphasis in the Chinese to filter,
For example:
> Def func (a, b) :
. Return the set (the list (a)). Issubset (set (the list (b)))
.
> A='round'
> B='there is a comb on the old round table'
> Func (a, b)
True

Well well thank you, and the convenience for the fun of   ??????
  • Related