Zen of Python „Explizit ist besser als implizit“Python

Python-Programme
Anonymous
 Zen of Python „Explizit ist besser als implizit“

Post by Anonymous »

Ich versuche zu verstehen, was „implizit“ und „explizit“ im Kontext von Python wirklich bedeuten.

Code: Select all

a = []

# my understanding is that this is implicit
if not a:
print("list is empty")

# my understanding is that this is explicit
if len(a) == 0:
print("list is empty")
Ich versuche, die Zen-Regeln von Python zu befolgen, bin aber neugierig, ob das in dieser Situation zutrifft oder ob ich zu viel darüber nachdenke?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post