- 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:

推薦閱讀
- Boost程序庫完全開發指南:深入C++”準”標準庫(第5版)
- Spring Boot開發與測試實戰
- LabVIEW Graphical Programming Cookbook
- 高效微控制器C語言編程
- 秒懂設計模式
- Reactive Programming With Java 9
- Mastering Drupal 8 Views
- Extreme C
- Software Development on the SAP HANA Platform
- Three.js權威指南:在網頁上創建3D圖形和動畫的方法與實踐(原書第4版)
- 3D Printing Designs:The Sun Puzzle
- Zend Framework 2 Cookbook
- Learning Redux
- Three.js Essentials
- Lync Server Cookbook