Question: Start by assigning to variable answers a list containing an arbitrary sequence of strings 'Y' and 'N'. For example: answers= ['Y','N','N','Y','N','Y','Y','Y','N','N','N'] Write Python statements corresponding

Start by assigning to variable answers a list containing an arbitrary sequence of strings 'Y' and 'N'. For example:

answers= ['Y','N','N','Y','N','Y','Y','Y','N','N','N']

Write Python statements corresponding to the following: (a) assign to variable numYes the number of occurrences of 'Y' in list answers. (b) assign to variable numNo the number of occurrences of 'N' in list answers. (c) assign to variable percentYest the percentage of strings in answers that are 'Y'. (d) sort the list answers. (e) Assign to variable f the index of the first occurrence of 'Y' in sorted list answers.

thank you in advance

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!