Farmers in India sow kharif crops with the rains and rabi crops in winter. A list gives the season of each crop. You will sort the crops by season and find the share of kharif crops.
The idea. Go through the crops, and keep those whose season matches. A sorted list puts the names in alphabetical order.
Your tasks.
kharif to the sorted list of the kharif crops.rabi to the sorted list of the rabi crops.kharif_share to the percentage of all the crops that are kharif, rounded to 1 decimal place.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…