- Mastering Python Scripting for System Administrators
- Ganesh Sanjiv Naik
- 87字
- 2021-07-02 14:00:25
max() and min()
Using the max() and min() functions, we can find the highest and lowest values from the tuple. These functions allow us to find out information about quantitative data. Let's look at an example:
>>> numbers = (50, 80,98, 110.5, 75, 150.58)
>>> print(max(numbers))
150.58
>>>
Using max(), we will get the highest value in our tuple. Similarly, we can use the min() function:
>>> numbers = (50, 80,98, 110.5, 75, 150.58)
>>> print(min(numbers))
50
>>>
So, here we are getting the minimum value.
推薦閱讀
- 新編Visual Basic程序設計上機實驗教程
- 數據庫系統原理及MySQL應用教程(第2版)
- 極簡算法史:從數學到機器的故事
- Qt 5 and OpenCV 4 Computer Vision Projects
- Spring 5企業級開發實戰
- 技術領導力:程序員如何才能帶團隊
- HTML5+CSS3基礎開發教程(第2版)
- Unity Game Development Scripting
- Learning Vaadin 7(Second Edition)
- Unity UI Cookbook
- Terraform:多云、混合云環境下實現基礎設施即代碼(第2版)
- ASP.NET程序開發范例寶典
- 自學Python:編程基礎、科學計算及數據分析(第2版)
- LabVIEW數據采集
- Java自然語言處理(原書第2版)