Python Forum

Full Version: If item in list = true, Output = xx
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all!
I am totally new to Python, i hope i can learn one day...
I am currently Working with Revit Architecture and Dynamo (Visual Programming).

And I need with a Python Script.
I am reading a large xlsx file into Dynamo, and i am reading it by Categories, f.e (walls, floors, roofs, windows, doors, etc..)
The xlsx is in Swedsih, and has to be translated to English. So currently I have a big list with something like string == ["yttervägg", "innervägg"]
Output = "Walls".

My problem is, IF the string != my list 100%, i get 0 output. I need something like, "if" whatever the Input is as a [string], if the item exists in my translated list, it get's outputet by my translation (f.e yttervägg = walls)!

As I said, im new to Python so i might've explained this poorly, but I need something like "if item exist in list" it gets output, same if several items exists, the output is in []

I just need an example on how to type it. Ty so much for your time!

/Kristoffer