Six values are read from the input, one per line, in this order:
word - a string.continuous_tense - the text True or False, converted to a bool.age - an integer.is_member - the text True or False, converted to a bool.color_code - a string; R means red, G green and B blue.time - a string in the format [2-digit hour][space][AM or PM], for example 02 PM.Using if / elif / else, assign these variables:
Part 1 - only if
new_word: start from word; if it ends with ing, drop that suffix; then, if continuous_tense is True, append ing.Part 2 - if ... else
age_group: "Adult" when age is 18 or more, otherwise "Child".applicant_type: the age group followed by the membership status, e.g. "Adult Member" or "Child Non-member".Part 3 - if ... elif ... else
color: the colour name in lower case for R, G or B, and "black" for any other code.is_time_valid: a bool, True when the hour part of time lies between 1 and 12 (both included).time_in_hrs: the hour on the 24-hour clock - 12 AM becomes 0, 12 PM stays 12, any other AM hour stays as it is, and any other PM hour has 12 added to it.time_of_day: "Morning" for 6 up to (but not including) 12, "Afternoon" for 12 up to 18, "Evening" for 18 up to 23, and "Night" for 0 up to 6. If is_time_valid is False, time_of_day is "Invalid" instead.Do not print anything; the seven variables above are checked for you.
The input is read for you. Assign the answers to new_word, age_group, applicant_type, color, is_time_valid, time_in_hrs, time_of_day.
You do not need to print anything — the values you assign to those names are what gets checked, in that order.
Input
glow
True
5
True
R
02 PM
Output
'glowing'
'Child'
'Child Member'
'red'
True
14
'Afternoon'