Proper loop header to drop into a loop based on parameters entered into a function
up vote
0
down vote
favorite
I am writing a python function that searches a file for classes that meet the requirements specified by the function's arguments and to put them into a list. I have found a somewhat convoluted way to generate the correct lists if all arguments are given, but I can't figure out how to make the function work properly if only a few of the arguments are entered. How would I create a loop header that will initialize if only X number of parameters are entered? Or, if this is a poor question, what alternatives are there? Thank you.
The function as it is currently written is as follows:
python function loops parameters arguments
New contributor
add a comment |
up vote
0
down vote
favorite
I am writing a python function that searches a file for classes that meet the requirements specified by the function's arguments and to put them into a list. I have found a somewhat convoluted way to generate the correct lists if all arguments are given, but I can't figure out how to make the function work properly if only a few of the arguments are entered. How would I create a loop header that will initialize if only X number of parameters are entered? Or, if this is a poor question, what alternatives are there? Thank you.
The function as it is currently written is as follows:
python function loops parameters arguments
New contributor
1
You forgot to include the code.
– mkrieger1
Nov 10 at 18:03
Don’t provide the picture of the code. meta.stackoverflow.com/questions/285551/…
– Banghua Zhao
Nov 10 at 18:48
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am writing a python function that searches a file for classes that meet the requirements specified by the function's arguments and to put them into a list. I have found a somewhat convoluted way to generate the correct lists if all arguments are given, but I can't figure out how to make the function work properly if only a few of the arguments are entered. How would I create a loop header that will initialize if only X number of parameters are entered? Or, if this is a poor question, what alternatives are there? Thank you.
The function as it is currently written is as follows:
python function loops parameters arguments
New contributor
I am writing a python function that searches a file for classes that meet the requirements specified by the function's arguments and to put them into a list. I have found a somewhat convoluted way to generate the correct lists if all arguments are given, but I can't figure out how to make the function work properly if only a few of the arguments are entered. How would I create a loop header that will initialize if only X number of parameters are entered? Or, if this is a poor question, what alternatives are there? Thank you.
The function as it is currently written is as follows:
python function loops parameters arguments
python function loops parameters arguments
New contributor
New contributor
edited Nov 10 at 18:14
snakecharmerb
8,69132246
8,69132246
New contributor
asked Nov 10 at 17:53
Jimmy Smith
1
1
New contributor
New contributor
1
You forgot to include the code.
– mkrieger1
Nov 10 at 18:03
Don’t provide the picture of the code. meta.stackoverflow.com/questions/285551/…
– Banghua Zhao
Nov 10 at 18:48
add a comment |
1
You forgot to include the code.
– mkrieger1
Nov 10 at 18:03
Don’t provide the picture of the code. meta.stackoverflow.com/questions/285551/…
– Banghua Zhao
Nov 10 at 18:48
1
1
You forgot to include the code.
– mkrieger1
Nov 10 at 18:03
You forgot to include the code.
– mkrieger1
Nov 10 at 18:03
Don’t provide the picture of the code. meta.stackoverflow.com/questions/285551/…
– Banghua Zhao
Nov 10 at 18:48
Don’t provide the picture of the code. meta.stackoverflow.com/questions/285551/…
– Banghua Zhao
Nov 10 at 18:48
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Jimmy Smith is a new contributor. Be nice, and check out our Code of Conduct.
Jimmy Smith is a new contributor. Be nice, and check out our Code of Conduct.
Jimmy Smith is a new contributor. Be nice, and check out our Code of Conduct.
Jimmy Smith is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241819%2fproper-loop-header-to-drop-into-a-loop-based-on-parameters-entered-into-a-functi%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
You forgot to include the code.
– mkrieger1
Nov 10 at 18:03
Don’t provide the picture of the code. meta.stackoverflow.com/questions/285551/…
– Banghua Zhao
Nov 10 at 18:48