I have 2 line lists for example:
listx = ["name","age","rank"] input = ["name","age"]
How to compare two lists to check if listx "name"and "age"in input?
listx
"name"
"age"
input
Is this homework? :)
You need to create one or two recursive functions to go through both lists and search for each line in the input.
Or you could find some good features in Prelude that help here.
B is a subset of A if B \ A is empty
so another way to do this is
import Data.List ((\\)) null (input \\ listx)
all (flip elem listx) input
. , , ...
.
import Data.Set (fromList input) `isSubsetOf` (fromList listX)
Source: https://habr.com/ru/post/1708114/More articles:Как выполнить строку за строкой и символом по символу diff на текст? - c#Django template includes - pythonEffectively modeling MruList in C # or Java - java`autoload` causes an error, but` require` is not (ruby) - ruby | fooobar.comExecuting the "Luminosity" filter in Photoshop - pythonMercurial API for .NET - apiBest way to eliminate all intermediate files from Visual Studio project folders? - visual-studioCompilation resulting in double warnings - c #Is aspnetdb.mdf ever intended for use in an online production application? - securityNested prohibit / require operators in search queries Lucene - javaAll Articles