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
#1
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Finding string in list item jesse68 8 1,856 Jun-30-2022, 08:27 AM
Last Post: Gribouillis
  sum() list from SQLAlchemy output Personne 5 4,438 May-17-2022, 12:25 AM
Last Post: Personne
  Need to parse a list of boolean columns inside a list and return true values Python84 4 2,087 Jan-09-2022, 02:39 AM
Last Post: Python84
  how to easily create a list of already existing item CompleteNewb 15 3,519 Jan-06-2022, 12:48 AM
Last Post: CompleteNewb
  Remove an item from a list contained in another item in python CompleteNewb 19 5,650 Nov-11-2021, 06:43 AM
Last Post: Gribouillis
  count item in list korenron 8 3,429 Aug-18-2021, 06:40 AM
Last Post: naughtyCat
  Time.sleep: stop appending item to the list if time is early quest 0 1,868 Apr-13-2021, 11:44 AM
Last Post: quest
  How to run a pytest test for each item in a list arielma 0 2,358 Jan-06-2021, 10:40 PM
Last Post: arielma
  How do I add a number to every item in a list? john316 2 1,964 Oct-28-2020, 05:29 PM
Last Post: deanhystad
  How to append to list a function output? rama27 5 6,699 Aug-24-2020, 10:53 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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