Question: PYTHON JES VERSION Image that you have a list of the genders (as single characters) or all the students in your class, in order of

PYTHON JES VERSION

Image that you have a list of the genders (as single characters) or all the students in your class, in order of their last name. The list will look something like "MFFMMMFFMFMMFFFM" where M is male and F is female. Write a function called percentageGenders(genderString) where genderString represents the genders. You must count all M's and F's in the string and print our the ratio (as a decimal) of each gender. For example, if the input string were "MFFF," then the function should print something like, "There are 0.25 males, 0.75females." (Hint: Better multiply something by 1.0 to make sure that you get floats not integers)

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!