Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
class Band: def __init__(self, name): self.name = name self.albums = [] def add_album(self, album): if album in self.albums: return f"Band {self.name} already has {album.name} in their library." self.albums.append(album): return f"Band {self.name} has added their newest album {album.name}." def remove_album(self, album_name): for album in self.albums: if album.name == album_name: if self.published return "Album has been published. It cannot be removed." self.albums.remove(album) return f"Album {album.name} has been removed." return f"Album {album.name} is not found." def details(self): result += f"Band {self.name}\n" for album in self.albums: result += album.details() + "\n" return result.strip()
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)