# the basic data structure is a List
moth_list = ['Hawk', 'Carpet', 'Pug']
moth_count = [28, 57, 32]
# print individual entries and summary
print('We have ' + str(len(moth_list)) + ' moth types')
print('The third moth type being ' + moth_list[2])
...
# two things to note
# take care with list copying
not_a_new_list = moth_list
is_a_new_list = moth_list.copy()
# and lists can be changed
not_a_new_list[2] = 'Snout'
...
# two more things
# running total using loop
moth_sum = 0
for curr_num in moth_count:
moth_sum = moth_sum + curr_num
print('In total ' + str(moth_sum) + ' moths')
# check if a moth is present
check_moth = input('Type moth search here - hint: Just answer Pug )')
if check_moth in moth_list:
print('yay we have a ' + check_moth)
else:
print('Missed!')