def quackpep(self): pep_facts = [ "PEP 8: Style Guide for Python Code", "PEP 20: The Zen of Python", "PEP 257: Docstring Conventions", "PEP 484: Type Hints", "PEP 498: Literal String Interpolation (f-strings)", "PEP 572: Assignment Expressions (walrus operator)", "PEP 703: Making the Global Interpreter Lock Optional" ] fact = random.choice(pep_facts) return f"{self.name} quacks a PEP fact: {fact}!" if name == " main ": d = Duck("Quackamole") print(d.quack()) print(d.quackpep())

def quack(self): return f"{self.name} says: Quack!"

import random class Duck: def (self, name="Donald"): self.name = name

Creado con Webered WEBERED