Python Forum
How search in multidim. list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How search in multidim. list
#1
Hi there.

I have questinon. I need to search in my multidimensional list by more than one key. There is list:
lis= [["id","type","city","price","rooms"],[0,"Flat","Prague",13000,5],[1,"Flat","Prague",1000,4],[2,"House","Prague",13020,10]]
For example, user enter to console this: search [key] [value] [key2] [value2][where/order]. -> search city Prague AND type Flat ORDER BY price. This can show list by id : 1,0.

I know how order items , thats ok. But i dont know, how to search first by city and then by type and order it.

Can you everybody help me?
Reply


Messages In This Thread
How search in multidim. list - by jakubmudra - Dec-22-2017, 07:34 PM
RE: How search in multidim. list - by buran - Dec-22-2017, 09:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Search Excel File with a list of values huzzug 4 1,312 Nov-03-2023, 05:35 PM
Last Post: huzzug
  search a list or tuple for a specific type ot class Skaperen 8 2,006 Jul-22-2022, 10:29 PM
Last Post: Skaperen
  Use one list as search key for another list with sublist of list jc4d 4 2,206 Jan-11-2022, 12:10 PM
Last Post: jc4d
  Search in an unsorted list amir_0402 2 16,676 Jun-04-2020, 10:25 PM
Last Post: deanhystad
  Alpha numeric element list search rhubarbpieguy 1 1,815 Apr-01-2020, 12:41 PM
Last Post: pyzyx3qwerty
  search binary file and list all founded keyword offset Pyguys 4 2,833 Mar-17-2020, 06:46 AM
Last Post: Pyguys
  Using Python to search through a list of urls jeremy 4 2,911 Dec-18-2019, 11:52 AM
Last Post: Malt
  Search a List of Dictionaries by Key-Value Pair; Return Dictionary/ies Containing KV dn237 19 6,840 May-29-2019, 02:27 AM
Last Post: heiner55
  Linear search/searching for a word in a file/list kietrichards 3 3,507 Mar-08-2019, 07:58 PM
Last Post: Larz60+
  How to iterate through a list and search for a value fad3r 2 2,886 Jan-23-2018, 02:07 AM
Last Post: fad3r

Forum Jump:

User Panel Messages

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