Use the builtin function max
.
Example:
max(2, 4)
returns 4.
Just for giggles, there’s a min
as well…should you need it. 😛
More Related Contents:
- Get the row(s) which have the max value in groups using groupby
- Getting key with maximum value in dictionary?
- How do I get indices of N maximum values in a NumPy array?
- Getting the index of the returned max or min item using max()/min() on a list
- Finding max value in the second column of a nested list?
- How to find all positions of the maximum value in a list?
- Python: Maximum recursion depth exceeded
- How to get the index of a maximum element in a NumPy array along one axis
- Find maximum value of a column and return the corresponding row values using Pandas
- What is the maximum float in Python?
- Find the item with maximum occurrences in a list [duplicate]
- numpy max vs amax vs maximum
- How to find the min/max value of a common key in a list of dicts?
- How to limit a number to be within a specified range? (Python)
- 5 maximum values in a python dictionary
- Find min, max, and average of a list
- Find the greatest number in a list of numbers
- Set maximum value (upper bound) in pandas DataFrame
- How to make numpy.argmax return all occurrences of the maximum?
- return max value from pandas dataframe as a whole, not based on column or rows
- Which maximum does Python pick in the case of a tie?
- Using Python’s max to return two equally large values
- Maximum and minimum value of C types integers from Python
- Max in a sliding window in NumPy array
- Check if all values in list are greater than a certain number
- Python Pandas add column for row-wise max value of selected columns [duplicate]
- Python: take max N elements from some list
- How to find the maximum number in a list using a loop?
- Find the greatest (largest, maximum) number in a list of numbers
- Get max value from row of a dataframe in python [duplicate]