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 3933276
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:34:57+00:00 2026-05-19T23:34:57+00:00

In MATLAB you have the ability to return tuples and assign to tuples of

  • 0

In MATLAB you have the ability to return tuples and assign to tuples of values the same as you do so in Python. In MATLAB, if a function returns a value you don’t want to assign to anything, you assign it to the special variable ~. For example, say a function f() returns a tuple (1, 2), then:

~, b = f()

Assigns 2 to b and 1 to nothing.

Is there an equivalent to this in Python? I understand I could just do:

a, b = f()

and ignore the value of a but I’d prefer skipping the assignment to a altogether. Rewriting the function f() is not an option.

I apologize if my Python terminology is wrong.

  • 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-05-19T23:34:57+00:00Added an answer on May 19, 2026 at 11:34 pm

    A common idiom in Python is to use _ for this purpose.

    However it’s not necessarily a good idea because this variable is also used in the interactive interpreter for the last result and assigning to it will stop this useful feature from working.

    Also _ is sometimes used for string translation, e.g. with gettext.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have matlab file matlab_param.m function matlab_param(param1, param2) disp(sprintf('param1 : %s', param1)); disp(sprintf('param2 :
I have a Matlab function that creates a cell array with matrixes inside. It
I have installed Matlab r2010a on my computer I need use the function xlsread
Python and Matlab quite often have integer date representations as follows: 733828.0 733829.0 733832.0
I have some Matlab code and a GUI for it and I want to
I have a matlab script lets say image_process.m and the function image_process accepts one
I have a matlab function img_process that requires the following parameters : image_name intensity
I have a MATLAB routine with one rather obvious bottleneck. I've profiled the function,
I have a Matlab script that requires a function in a DLL, and calls
I want to use the matlab function roots in a function. But it doesn't

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.