(The original string ss remains unchanged. A new string tt is created.)
The methods upper() and lower() doesn't change the original string, just creat a copy with the changes applied.
(The original string ss remains unchanged. A new string tt is created.)
The methods upper() and lower() doesn't change the original string, just creat a copy with the changes applied.
Some of the things that people do naturally, without difficulty or conscious thought, are the hardest to express algorithmically.
Interesting though!
On the other hand, the while statement is dependent on a condition that needs to evaluate to False in order for the loop to terminate. Since we do not necessarily know when this will happen, it creates what we call indefinite iteration.
While Loop - pode ser definido como uma interação indefinida.
Since we know that it will iterate once for each value in the collection, it is often said that a for loop creates a definite iteration because we definitely know how many times we are going to iterate.
Loop For - constitui o que pode ser chamado de iteração definida.