How to use Loop traversal in python
This article mainly introduces how to use loop traversal in python, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Application scenario
1. You can use for in to traverse tuples.
2. The parameters and return values of the function.
A function can accept multiple parameters or return multiple data at a time.
3. format string, the () after the format string is essentially a tuple.
4. In order to protect the data security, the list cannot be modified.
Example
Mode 1 tuple1= ('Zhang San', 'wang',23,56,3.4') for temp in tuple1: print (temp) mode 2 tuple1 = ('Zhang San', 'wang',23,56,3.4) i=0while I