All pastes #966966 Raw Edit

Something

public python v1 · immutable
·published 2008-04-02 03:04 UTC
rendered paste body
class Song:	total_plays = 0	def __init__(self, name, artist, duration):		self.name = name		self.artist = artist		self.duration = duration		self.plays = 0	def __str__(self):		return "Song: #{@name}--#{@artist} (#{@duration})"	def play(self):		self.plays += 1		Song.total_plays += 1		print "This song: %s plays. Total: %s plays." % (self.plays, Song.total_plays)	def getDurationInMinutes(self):		# Just using a floating point value (60.0) forces it to floating-point.		return (self.duration / 60.0)	def setDurationInMinutes(self,duration):		self.duration = int(duration * 60)