directory

  • Introduction to The Python Max function
  • 2.Python Max function
  • Three. Guess you like it

Python Basics: Python Basics

Introduction to The Python Max function

Max functionReturns the maximum value of a given argument, which can be sequential syntax:

# Return value: returns the maximum value of an argument; max( x, y, z, .... )Copy the code

2.Python Max function

#! Usr /bin/env python # -* -coding :utf-8 _*- """ @author: www.codersrc.com @file :Python Max function. Py @time :2021/05/09 08:00 @Motto: A thousand miles without a single step, a small stream cannot become a river sea, program life needs to keep on accumulating! Print (Max (1,5)) print(Max (5.5,6100,1,-10,20)) ""Copy the code

Note: Max can only be of type int or float, other types will report an error, such as:

#! Usr /bin/env python # -* -coding :utf-8 _*- """ @author: www.codersrc.com @file :Python Max function. Py @time :2021/05/09 08:00 @Motto: A thousand miles without a single step, a small stream cannot become a river sea, program life needs to keep on accumulating! """ print(max(1,'a')) TypeError: '>' not supported between instances of 'str' and 'int'Copy the code

3.Guess you like

  1. Python conditional derivation
  2. Python list derivation
  3. Python dictionary derivation
  4. Python variable length arguments *argc/**kargcs
  5. The Python anonymous function lambda
  6. Python Return logical judgment expressions
  7. Python is and == are different
  8. Python is mutable and immutable
  9. Shallow and deep Python copies
  10. Python Exception handling
  11. The Python thread creates and passes parameters
  12. Python thread mutex Lock
  13. Python thread time Event
  14. The Python thread Condition variable Condition
  15. Python thread Timer Timer
  16. Python thread Semaphore
  17. The Python thread Barrier object
  18. Python Thread Queue – FIFO
  19. Python thread queue LifoQueue – LIFO
  20. Python 线程优先队列 PriorityQueue
  21. ThreadPoolExecutor(1)
  22. ThreadPoolExecutor(2)
  23. The Python Process module
  24. The Python Process is different from the threading Process
  25. Queue/Pipe for communication between Python processes
  26. Python process Pool multiprocessing.pool
  27. Python GIL lock

The Python Max function

This article is posted by the blog – Ape says Programming Ape says Programming!