Python blackjack program code issue. Why is it returning key "1" instead of "10"?

I used python tutor to step through the code and found that there is a bug in user_current_score(). for cards.get(card), it is pulling the "10" dictionary key but seeing it as a 1 instead, then returning None since there is no 1 card. Why would it be seeing a 1 card in the dictionary when… Read More Python blackjack program code issue. Why is it returning key "1" instead of "10"?

Get the most frequent value of several variables

I am trying to get the most frequent value for each variable in a dataset in python. For example, I want to know the most frequent preferred color for a person per city. data = {‘Name’:[‘Tom’, ‘nick’, ‘krish’, ‘jack’, ‘John’, ‘Bettany’, ‘Leo’, ‘Aubrie’, ‘Martha’, ‘Grant’], ‘Age’:[20, 21, 19, 18,24,25,26,26,27, 25], ‘Prefered color’:[‘green’, ‘green’, ‘red’, ‘blue’,… Read More Get the most frequent value of several variables

dictionary inside dictionary sorting

this is the dict i need to sort it by "error" value {‘mdouglas’: {‘INFO’: 2, ‘ERROR’: 3}, ‘noel’: {‘INFO’: 6, ‘ERROR’: 3}, ‘breee’: {‘INFO’: 1, ‘ERROR’: 5}, ‘ac’: {‘INFO’: 2, ‘ERROR’: 2}, ‘blossom’: {‘INFO’: 2, ‘ERROR’: 6}, ‘rr.robinson’: {‘INFO’: 2, ‘ERROR’: 1}, ‘mcintosh’: {‘INFO’: 4, ‘ERROR’: 3}, ‘jackowens’: {‘INFO’: 2, ‘ERROR’: 4}, ‘oren’: {‘INFO’: 2,… Read More dictionary inside dictionary sorting