Python Forum
If item in list = true, Output = xx
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If item in list = true, Output = xx
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!


Messages In This Thread
If item in list = true, Output = xx - by kroh - Feb-19-2020, 09:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  count item in list korenron 7 283 Jul-01-2021, 01:46 PM
Last Post: deanhystad
  Time.sleep: stop appending item to the list if time is early quest 0 356 Apr-13-2021, 11:44 AM
Last Post: quest
  How to run a pytest test for each item in a list arielma 0 485 Jan-06-2021, 10:40 PM
Last Post: arielma
  How do I add a number to every item in a list? john316 2 432 Oct-28-2020, 05:29 PM
Last Post: deanhystad
  How to append to list a function output? rama27 5 1,033 Aug-24-2020, 10:53 AM
Last Post: DeaD_EyE
  Ignoring a list item hank4eva 2 714 Aug-17-2020, 08:40 AM
Last Post: perfringo
  Select correct item from list for subprocess command pythonnewbie138 6 904 Jul-24-2020, 09:09 PM
Last Post: pythonnewbie138
  Why is the item not in list when it is DanielCook 2 654 Jul-08-2020, 07:38 PM
Last Post: deanhystad
  best way to add item to list only once Phaze90 1 787 May-01-2020, 05:02 AM
Last Post: bowlofred
  item from a line to list however when i print the line instead of words i get letters Sutsro 5 897 Apr-22-2020, 02:39 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020