Write a function zodiac_sign()
that accepts a date as an input and returns the astrological sign of the zodiac corresponding to that date. The date ranges for each sign are given in the following table:
Zodiac sign | Start date | End date |
---|---|---|
Aries | March 21 | April 19 |
Taurus | April 20 | May 20 |
Gemini | May 21 | June 20 |
Cancer | June 21 | July 22 |
Leo | July 23 | August 22 |
Virgo | August 23 | September 22 |
Libra | September 23 | October 22 |
Scorpio | October 23 | November 21 |
Sagittarius | November 22 | December 21 |
Capricorn | December 22 | January 19 |
Aquarius | January 20 | February 18 |
Pisces | February 19 | March 20 |
Use the function zodiac_sign
to retrieve the zodiac sign of Nicolaus Copernicus whose birth date is February 19, 1473. Store this in the object Copernicus_sign
.
(from: Cotton, 2013, Learning R, O’Reilly)