TGViewer
Learn Python Coding Learn Python Coding @pythonre Β· 40.9K subscribers
Post #8794 2.02K
🐍 Minimum and Maximum in Python

To quickly get the minimum and maximum value from a sequence, use the built-in functions min() and max(). 
Both support the default parameter β€” it sets the default value if the sequence is empty. 
Subscribe for more tips every day!

numbers = [3, 7, 2, 9]

print(min(numbers))   # 2
print(max(numbers))   # 9

# example with an empty list
print(min([], default=0))  # 0
print(max([], default=0))  # 0


https://t.me/DataScience4 🌟
  • ❀ 6
More from @pythonre
  1. Oct 17, 2026😰 15-Hour "Python for Data Science" Course ⚑️ Learn Python for Data Science https://enghu…
  2. Oct 13, 2026https://substack.com/@husseinsheikho?utm_source=share&utm_medium=android&r=3hwnr8 Follow m…
  3. Oct 10, 2026πŸ“š Download 10 Python books for FREE: 1. Think Python β€” O’Reilly https://t.co/X7y3pX68IW 2…
  4. Oct 7, 2026Python Lists: A Quick Reference 🐍 * Definition: Lists are ordered, mutable collections th…
  5. Oct 7, 2026πŸ“± 270 tools for Python developers The repository contains: 🫑 Linters and formatters; πŸ«‘β€¦
  6. Oct 7, 2026Hands On Python Data Science - Data Science Bootcamp Master Python for Data Science with R…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook β†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 β†’