Python Forum
Displaying list correspond to the column number
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Displaying list correspond to the column number
#1
Hello guys

I have a problem finding a solution for the lists.
I have a function all_list which takes two parameters (listas, column[]). Inside of the column parameter User chooses to pass for example two values [0,1] , those numbers correspond to the element inside of the list which should be display. For example : all_list (['Mars','Hot',22,True],column[0,1]. The display values should be ['Mars','Hot'] if no column value then all list should be display like ['Mars','Hot',22,True]

def all_list(listas,column[]):
    #for no columns value
    if column == []:
        print(listas)
    #how to do when user use [0,2]or [1,2] etc.
Reply


Messages In This Thread
Displaying list correspond to the column number - by danlopek14q - Apr-04-2021, 10:02 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  list digit into number Voldyy 2 1,642 Jul-10-2022, 06:13 PM
Last Post: deanhystad
  How to convert every even number in a list to odd? Bruizeh 4 3,945 Aug-27-2021, 03:04 AM
Last Post: naughtyCat
  Get the biggest number from a two dimensional list rs74 13 4,322 Aug-09-2020, 04:02 PM
Last Post: deanhystad
  How can I print the number of unique elements in a list? AnOddGirl 5 3,428 Mar-24-2020, 05:47 AM
Last Post: AnOddGirl
  Multiplying number in a list in an order pythoneer 12 6,859 Mar-23-2018, 08:21 PM
Last Post: buran
  Displaying number of currency danellapotter 3 2,892 Jan-16-2018, 07:58 PM
Last Post: buran
  adding a number to the list atux_null 4 4,010 Nov-06-2017, 07:01 PM
Last Post: gruntfutuk
  Displaying a long list with Rows and Columns ngr33n 5 11,244 Sep-21-2017, 10:17 PM
Last Post: ngr33n
  sorted list not displaying Crackity 6 5,278 Jul-18-2017, 12:50 PM
Last Post: sparkz_alot
  Determine if a list contains a specific number of an item flannel_man 3 5,035 Nov-12-2016, 04:46 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

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