Sorry for likely simple questions but cant seem to find the answers and the group was awesome with my last simple question. Amazing how much time can be spent looking for answer. Ive certainly spent plenty on this one. Learned a lot in the process of looking but cant find my specific answer
I just have a simple list and want to use an individual item from the list as an arguement in a function when I call the function.
Error is “list() takes at most 1 argument (6 given)
I have tried many variations of this trying to get it correct. Below I have pasted current form of code.
Abbreviated Code below (weight_lbs and ideal_body_wt are calculated by other functions assigned to a variable and passed to this function):
percent = list(40, 50, 55, 60, 70, 80)
def Weight_After_PercentageEWL(percent, weight_lbs, ideal_body_wt):
x = weight_lbs - (percent * ideal_body_wt)
weight_after_percentewl = Weight_After_PercentageEWL(percent, weight_lbs, ideal_body_wt)
print('With Sleeve Gastrectomy patients lose between 40% and 60% Excess Weight Loss. This would put your weight between ' + str(Weight_After_PercentageEWL(percent[0], weight_lbs, ideal_body_wt)) + ' and ' + str(Weight_After_PercentageEWL(percent[3] , weight_lbs, ideal_body_wt)))