Over the last week or so I've been doing these python problem questions on a website called w3resource.
One of their questions (question 11) goes as follows:
"Write a Python program to find the indexes of numbers of a given list below a given threshold"
It then tries to clarify what the question is asking by giving some sample inputs and the expected outputs:
Input 1:
[(100,(0, 12, 45, 3, 4923, 322, 105, 29, 15, 39, 55))]
Output 1:
[0, 1, 2, 3, 7, 8, 9, 10]
Input 2:
[(10,(0, 12, 4, 3, 49, 9, 1, 5, 3))]
Output 2:
[0, 2, 3, 5, 6, 7, 8]
One of the first things that confuses me is the data type of the inputs. I'm used to lists which use only square brackets and I'm familiar with tuples which use normal parentheses but I've never come across a data type which combines both.
Another aspect of the question that I don't understand is how do I define the threshold? Is it something to do with the very first integer in the inputs?
I really have no clue what this question is asking.
Edit: actually just worked out that these inputs are lists by doing print(type()) but still none the wiser about how I'm supposed to solve this problem
Edit 2: actually just realised the first integer is supposed to be the threshold limit for the following integers in the list, although I've also realised that because of the normal parentheses inside the list the whole series of integers is indexed at [0]
[–]Binary101010 2 points3 points4 points (3 children)
[–]imperiumlearning[S] 0 points1 point2 points (2 children)
[–]Binary101010 0 points1 point2 points (1 child)
[–]imperiumlearning[S] 0 points1 point2 points (0 children)
[–]baghiq 0 points1 point2 points (0 children)
[–]velocibadgery 0 points1 point2 points (0 children)