I have a list which contains 3 machines in python which is ARRAY_MACHINE= ['machine1', 'machine2', 'machine3']
And, I want to write a script that can access 2 or 3 items at a same time in that list (depend on the array). If the ARRAY_MACHINE has 3 items like above, it will print out
The machines are machine1, machine2, machine3
If the ARRAY_MACHINE has 2 items, it will print out.
The machines are machine1, machine2
How can I do that? So far, I used while loop to do that, and it can only loop through each item in that list.