id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

get_percent_even


Write a function named get_percent_even that accepts a list of integers as a parameter and returns the percentage of the integers in the list that are even numbers. For example, if a list a stores [6, 4, 9, 11, 5], then your function should return 40.0 representing 40% even numbers. If the list contains no even elements or is empty, return 0.0. Do not modify the list passed in and round the result to 1 decimal place.


get_percent_even([6, 2, 9, 11, 3]) → 40.0
get_percent_even([1, 2]) → 50.0
get_percent_even([3, 5, 7, 9, 11]) → 0.0

...Save, Compile, Run (ctrl-enter)

def get_percent_even(lst):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 290 Post-solution available

Copyright Nick Parlante 2017 - privacy