書名: Mastering Python Scripting for System Administrators作者名: Ganesh Sanjiv Naik本章字?jǐn)?shù): 87字更新時(shí)間: 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.
推薦閱讀
- OpenStack Cloud Computing Cookbook(Third Edition)
- Web應(yīng)用系統(tǒng)開(kāi)發(fā)實(shí)踐(C#)
- Intel Galileo Essentials
- SpringMVC+MyBatis快速開(kāi)發(fā)與項(xiàng)目實(shí)戰(zhàn)
- 64位匯編語(yǔ)言的編程藝術(shù)
- Android底層接口與驅(qū)動(dòng)開(kāi)發(fā)技術(shù)詳解
- 數(shù)據(jù)結(jié)構(gòu)習(xí)題解析與實(shí)驗(yàn)指導(dǎo)
- R語(yǔ)言與網(wǎng)絡(luò)輿情處理
- Domain-Driven Design in PHP
- Building Serverless Architectures
- Emotional Intelligence for IT Professionals
- Access數(shù)據(jù)庫(kù)應(yīng)用教程(2010版)
- JavaWeb從入門到精通(視頻實(shí)戰(zhàn)版)
- ASP.NET Core and Angular 2
- Splunk Essentials