- Hands-On Penetration Testing with Python
- Furqan Khan
- 120字
- 2021-07-02 14:13:51
Replication with len(), max(), and min()
The multiplication operator *, when applied to lists, causes a replication effect of the list elements. The contents of the list are repeated as many times as indicated by the number passed to the replication operator:

The len() method gives the length of the Python lists. The max() method returns the maximum element of the list, while the min() method returns the minimum element of the list:

We can use the max and min methods on the character types as well, but we cannot use them on a list that has mixed or heterogeneous types. If we do this, we will get an exception stating that we are trying to compare numbers and characters:

推薦閱讀
- Learning NServiceBus(Second Edition)
- Mastering Articulate Storyline
- Apex Design Patterns
- 概率成形編碼調制技術理論及應用
- 從Excel到Python:用Python輕松處理Excel數據(第2版)
- Unity 2D Game Development Cookbook
- NoSQL數據庫原理
- INSTANT Yii 1.1 Application Development Starter
- Spring Boot+MVC實戰指南
- Mastering Apache Storm
- C編程技巧:117個問題解決方案示例
- STM8實戰
- 大數據時代的企業升級之道(全3冊)
- Head First Kotlin程序設計
- Java 11 and 12:New Features