Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SIGNS = 'ARI:03,21--04,19;TAU:04,20--05,20;GEM:05,21--06,21;CAN:06,22--07,22;' + 'LEO:07,23--08,22;VIR:08,23--09,22;LIB:09,23--10,23;SCO:10,24--11,20;' + 'SAG:11,21--12,21;CAP:12,22--01,20;AQU:01,21--02,21;PIS:02,22--03,20;' def find_astrological_sign(month: int, date: int) -> str: ''' Given two int values representing a month and

SIGNS = 'ARI:03,21--04,19;TAU:04,20--05,20;GEM:05,21--06,21;CAN:06,22--07,22;' + \ 'LEO:07,23--08,22;VIR:08,23--09,22;LIB:09,23--10,23;SCO:10,24--11,20;' + \ 'SAG:11,21--12,21;CAP:12,22--01,20;AQU:01,21--02,21;PIS:02,22--03,20;'

def find_astrological_sign(month: int, date: int) -> str: ''' Given two int values representing a month and a date, return a 3-character string that gives us what star sign a person born in that month and on that date belongs to. Use the SIGNS string (already defined for you at the top of this file) to figure this out.

NOTE FROM BOB: A lot of string slicing to do here. It looks like the information for each sign is exactly 17 characters long. We can probably use that.

>>> find_astrological_sign(8, 24) 'VIR'

>>> find_astrological_sign(12, 31) 'CAP' '''

Please help with this question in Python.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Power Of Numbers In Health Care A Students Journey In Data Analysis

Authors: Kaiden

1st Edition

8119747887, 978-8119747887

More Books

Students also viewed these Databases questions