Menu

[Solved] Getmostmissed Deck Quizstats Returns List Cards Deck Missed Quiz Example Previous Example Q37160092

get_most_missed(deck, quiz_stats): Returns a list of cards fromthe deck which were most missed during the quiz. For example, inthe previous example the card with id 2 is the most missed. Notethat you are returning a list because there may be ties for “mostmissed”. Hint: try this in two parts… (1) determine the mostmissed question (just like finding the max), then (2) put all cardswhich have that miss-rate into a list. Hints/Tips: • Maybe a helpermethod would be good for most_missed(). If you think you want one(maybe to calculate the percentage missed for a single card?), thenwrite one! If you’re good without that, then do it your way☺shuffle(seq): Shuffle the list passed in using the followingalgorithm: for each location in the list, swap the item at thatlocation with a random item from with itself of something furtherdown the list. This should work to shuffle any list (deck of cards,list of ints, etc.) Example: • Let’s say you have a list:[‘cat’,’dog’,’fox’,’goat’] • Start with the first item (‘cat’) andswap it with itself or a random item later in the list. • Let’s sayyou swap with ‘goat’, so you have a new list:[‘goat’,’dog’,’fox’,’cat’] • The second item is ‘dog’, so swap itwith itself or a random item later in the list. • Let’s say youswap with ‘fox’, so you have a new list: [‘goat’,’fox’,’dog’,’cat’]• The third item in the list is now ‘dog’, so swap it with itselfor a random item later in the list. • Let’s say you swap it withitself, so your list is [‘goat’,’fox’,’dog’,’cat’] • The last itemcan only swap with itself, so it will stay in place Hints/Tips: •How do you get a random number? We’ve imported the random module’snextint() function for you! You can use that to generate randomnumbers between two values. For example: nextint(1,10) willgenerate a random number between 1 and 10 inclusive. So, a randomnumber between index i and the end of a list seq (inclusive) wouldbe nextint(i,len(seq)-1). All in PYTHON 3

Expert Answer


Answer to get_most_missed(deck, quiz_stats): Returns a list of cards from the deck which were most missed during the quiz. For exa… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *