Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use Loop traversal in python

Shulou Source: shulou.com Published: 2022-06-03 15:34:05 11月14日 Update

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

Tags: Articles loops functions parameters multiple characters strings data methods formats Zhang San security value interests at the same time scenarios examples more friends essence Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Tech Info Huawei Apple Docker