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:



enter image description here










share|improve this question









New contributor




Jimmy Smith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 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















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:



enter image description here










share|improve this question









New contributor




Jimmy Smith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 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













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:



enter image description here










share|improve this question









New contributor




Jimmy Smith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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:



enter image description here







python function loops parameters arguments






share|improve this question









New contributor




Jimmy Smith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Jimmy Smith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 10 at 18:14









snakecharmerb

8,69132246




8,69132246






New contributor




Jimmy Smith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 10 at 17:53









Jimmy Smith

1




1




New contributor




Jimmy Smith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Jimmy Smith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Jimmy Smith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 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




    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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Jimmy Smith is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















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






























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.










 

draft saved


draft discarded


















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.















 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Bressuire

Vorschmack

Quarantine