Simple CheatSheet
    • PythonPython
    • DatabaseDatabase
    • Operating SystemOperating System
    • ProgrammingProgramming
    • Linux CommandLinux Command
    • ToolkitToolkit
    • OtherOther
    • Keyboard ShortcutsKeyboard Shortcuts
Dart
Dart
HTML Canvas
HTML Canvas
Redis
Redis
Bash
Bash
JavaScript
JavaScript
Python
Python Loops

for/else

nums = [60, 70, 30, 110, 90]
for n in nums:
    if n > 100:
        print("%d is bigger than 100" %n)
        break
else:
    print("Not found!")

Also see: Python Tips

Comments
Related
  • Miscellaneous
  • Python Classes & Inheritance
  • Python File Handling
  • Python Modules
  • Python Functions
  • Python Loops
  • Python Flow control
  • Python Lists
  • Python F-Strings (Since Python 3.6+)
  • Python Strings
  • Python Advanced Data Types
  • Python Built-in Data Types
  • Getting Started