python - Does tuple sort itself when looped through -


I have a tube that has many values ​​that I use to search for some files. I found this method as an input method. I try to search for that value (text) in a file and remove the related result. But I have a requirement that if that text is not found, then search for the 'unknown' value in that file and return the corresponding values. To achieve this, I am planning to add Tupal to 'Unknown' so that if it does not get anything, then it will be something like the 'Unknown' Will return But my question is, if I suppress 'unknown' at the end, looping is used in the same sequence while looping through this tube, in which the elements have been added? I tried to open the python and saw that it hides through it in the same order. But I do not want to accidentally search my code for the 'unknown' value before the intended ones. help please.

Looping on Tupless always goes from the first element to the last.

  & gt; & Gt; & Gt; In x ('asdf', 5, none): ... print x ... asdf 5 none    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -