Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8249341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:30:33+00:00 2026-06-07T23:30:33+00:00

I have three lists in python. Let’s say : list_a list_b list_c Now I

  • 0

I have three lists in python. Let’s say :

list_a
list_b
list_c

Now I am calling a method which also return a list and save into the above lists.
For example:

list_a = get_value(1)
list_b = get_value(2)
list_c = get_value(3)

I think the way I choose to call a same methods with different parameters are not a good option. Would it be possible for us to call these methods within one line?

I am beginner in Python, but what about the tuple option?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:30:35+00:00Added an answer on June 7, 2026 at 11:30 pm

    A list of lists?

    ll = [get_value(x) for x in (1, 2, 3)]
    

    or with your three lists:

    list_a, list_b, list_c = [get_value(x) for x in (1, 2, 3)]
    

    taking into account, that get_value cannot be modified and returns just the single list.

    Another possibility would be a dictionary.

    params = {'a': 1, 'b': 2, 'c': 3}
    result = {k:get_value(v) for k,v in params.iteritems()}
    # result == {'a': get_value(1), 'b': get_value(2), 'c': get_value(3)}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have 2 lists in Python and I want to loop through
Let's say I have three sentences: hello world hello python today is tuesday If
Let's say I have a list of objects. (All together now: I have a
Let's say you have a view called View Story which is just a web
For the sake of simplicity, let's say I have a Person class in Python.
i have three lists with the same number of elements in each other, i
I have three lists, I need to move Animal object from list animalSource to
I have three lists of lists, and I'm trying to write a generator function
I have three lists that I want to convert into one list. When I
Suppose I have three lists: list1 = a, c, d, r, t list2 =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.