Based on past experience the library is especially designed as a last resort to handle the current circumstances.
Particular functionality is the mind-reading(), wave_hands() and bingo() functions
Thanks againtry and lastchance. I can see that with the latest code as above, the output (1+2+3 = 6) total. Again if append element 4 and creates additional total from [2,3,4]. There would now be two totals (1+2+3 = 6 and 2+3+4 =9). At this point contains(6) and contains(9) should return True, while contains(7) should return False.
There would now be two totals (1+2+3 = 6 and 2+3+4 =9). At this point contains(6) and contains(9) should return True, while contains(7) should return False.
denver2020 wrote:
In code suggested by seeplus, it output the same behavior.
@denver2020, perhaps you had better explain WHAT output you actually want from that sequence. As far as I can see, mine, @seeplus's and @mbozzi's codes return true when tested with 6 and 9 once the vector is [1,2,3,4], and if we had tested with 7 it would have returned false.
If you want something else then you had better explain more clearly.
Sorry for the confusion here.
All I need is that when you provide the output here like (1+2+3 = 6) it must give total as 6. Again if append element 4 and creates additional total from [2,3,4]. So there would now be two totals here now (1+2+3 = 6 and 2+3+4 =9) respectively. At this point contains(6) and contains(9) should return "True", while contains(7) should return "False". Hope its clear now.
@OP
No it’s not clearer.
All you’re doing is repeating the same incoherence you started with for about the third or fourth time. Remember, it’s your problem, not ours
You have been given a number of clearly written choices based on that same gibberish in good faith from which you can pick and choose what suits you.
So green tick the thread and move on.