In: Computer Science
Write a Python program that takes information from the user about a spider seen in North America and returns whether it is likely to be a dangerous spider. The only two spiders in North America that are actually dangerous are the widow and recluse. The program will ask the user for the following information: color and special markings.
printWelcome – prints program information
printColorMenu – Color menu options should be brown, black, other
printSpecialMarkingsMenu – Special markings options should be hour glass on underside, violin shape on head, other
main – takes in color option and returns spider information as follows:
def printWelcome ():
print('''This program takes information from the user about a
spider seen in North America and returns
whether it is likely to be a dangerous spider. The only two spiders
in North America that are actually
dangerous are the widow and recluse.\nThe program will ask the user
for the following information: color
and special markings.''')
print('\n')
def printColorMenu ():
print('Select color:')
print('1: brown\n2: black\n3: other')
def printSpecialMarkingsMenu():
print('Select special markings:')
print('1: hour glass on underside\n2: violin shape on head\n3:
other')
def main():
printWelcome()
printColorMenu()
col = int(input(">> "))
printSpecialMarkingsMenu()
mark=int(input(">> "))
if col==1:
if mark==1:
print('brown widow is dangerous')
elif mark==2:
print('brown recluse is dangerous')
else:
print('likely not dangerous')
elif col==2:
if mark==1:
print('black widow is dangerous')
else:
print('likely not dangerous')
else:
print('likely not dangerous')
main()