Skip to content

den01-python-programming-exercises/exercise-5-11-song-JaimePSantos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Work in Repl.it

Exercise 5.11 Song

In the exercise base there is a class called Song that can be used to create new objects that represent songs. Add to that class the __eq__ method so that the similarity of songs can be examined.

jack_sparrow = Song("The Lonely Island", "Jack Sparrow", 196)
another_sparrow = Song("The Lonely Island", "Jack Sparrow", 196)

if (jack_sparrow == another_sparrow):
    print("Songs are equal.")

if (jack_sparrow == "Another object"):
    print("Strange things are afoot.")
Songs are equal

About

exercise-5-11-song-JaimePSantos created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages