Wite python statements corresponding to the following


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.

Solution Preview :

Prepared by a verified Expert
Computer Engineering: Wite python statements corresponding to the following
Reference No:- TGS02929429

Now Priced at $15 (50% Discount)

Recommended (97%)

Rated (4.9/5)