avatar Bite 187. Actor/actress age at movie release

Ever wondered how old an actor/actress was in a particular movie? In this Bite you will write some code to find the answer.

Here is how it should work (the Actor and Movie dataclasses are provided):

  (Pdb) actor
  Actor(name='Wesley Snipes', born='July 31, 1962')
  (Pdb) movie
  Movie(title='New Jack City', release_date='January 17, 1991')
  (Pdb) get_age(actor, movie)
  'Wesley Snipes was 28 years old when New Jack City came out.'
  (Pdb) actor
  Actor(name='Jennifer Aniston', born='February 11, 1969')
  (Pdb) movie
  Movie(title='Horrible Bosses', release_date='September 16, 2011')
  (Pdb) get_age(actor, movie)
  'Jennifer Aniston was 42 years old when Horrible Bosses came out.'

You might want to look into using dateutil to make this a lot easier :)

Keep calm and code in Python!

Login and get coding
go back Intermediate level
Bitecoin 3X

Will you be the 150th person to crack this Bite?
Resolution time: ~24 min. (avg. submissions of 5-240 min.)
Our community rates this Bite 2.75 on a 1-10 difficulty scale.
» You can do it! 😌

Focus on this Bite hiding sidebars, turn on Focus Mode.

Ask for Help