1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alla [95]
4 years ago
5

The function below, find_largest_value_key, takes a single argument: a dictionary data_dict. The dictionary can have any data ty

pe as a key, but all of the dictionaries values are of type integer. All of the values are positive integers. Complete the function below to return the key which corresponds to the largest value in the dictionary. For example, given the dictionary {"sample": 15, 5: 25}, the function should return 5
Computers and Technology
1 answer:
Andreyy894 years ago
7 0

Answer:

The completed code for the function in Python is given in the bold font.

Explanation:

def find_largest_value_key(data_dict):

   largeValue = None

   result = None

   for k in data_dict.keys():

       if(largeValue==None or largeValue<data_dict[k]):

           largeValue = data_dict[k]

           result = k

   return result

You might be interested in
The first step of converting data into a table is:
adell [148]
B. Select the range of data. You have to highlight it first so it knows what you are going to convert into a table.
8 0
3 years ago
30 POINTS PLEASE HURRY<br><br><br> How do you use information technology in your daily life?
JulsSmile [24]
You are using it right now! Information technology is the use of systems for storing, retrieving, and sending information. Examples include computers and phones which most people use daily to browse the internet, use programs like Microsoft Word, apps like Brainly, etc.
8 0
4 years ago
Premise: Tracy has a file that contains a list of actors and the movies in which they acted. She wants to know the top 3 ranked
anzhelika [568]

Answer:

see explaination

Explanation:

Python version : 2.7

Python program to read an input file with specified number of records to read

and output the top 3 ranked actors

The format of input file:

<number of records to read>

<actor_name>,<movie_name>

<actor_name>,<movie_name>

....

'''

#define the file name

filename = 'actors_movies.txt'

# create an empty dictionary to contain the actor name as key and number of movies they have acted as value

actors_movie_count = {}

# open the flie

fp = open(filename)

line = fp.readline() # read the first line

count = int(line)

i = 0

# loop to read count number of lines from file

while i < count:

line = fp.readline() # read a line

data = line.split(",") # split the input data into list of strings using comma as the delimiter

# check if actor name is present in the dictionary, then add 1 to its value

# strip is used to remove any leading or trailing space

if data[0].strip() in actors_movie_count:

actors_movie_count[data[0].strip()] += 1

else: # else insert a new record with actor name as its key and 1 as value

actors_movie_count[data[0].strip()] = 1

i += 1

# close the file

fp.close()

# get the list of names of actors and list of number of movies they have acted

actors = actors_movie_count.keys()

num_movies = actors_movie_count.values()

# loop to sort the actors list and num_movies list in descending order of count of movies

for i in range(len(num_movies)-1):

max = i

for j in range(i+1,len(num_movies)):

if num_movies[j] > num_movies[max]:

max = j

if max != i:

actors[max], actors[i] = actors[i], actors[max]

num_movies[max], num_movies[i] = num_movies[i], num_movies[max]

# rank the actors to add top 3 ranked actors to rank_actors list

rank = 1

rank_actors = []

# add the first actor to list

rank_actors.append(actors[0])

# loop from second to end of actors list

for i in range(1,len(actors)):

# if this actor has same number of movies as the actor before him, then assign same rank

if num_movies[i] == num_movies[i-1]:

# if rank <= 3, add the actor in rank_actors list

if rank <= 3:

rank_actors.append(actors[i])

else: # rank > 3, exit the loop

break

else: # assign 1 more rank that the previous

rank += 1

# if rank <= 3, add the actor in rank_actors list

if rank <= 3:

rank_actors.append(actors[i])

else: # rank > 3, exit the loop

break

# loop to display the top 3 ranked actors

for actor in rank_actors:

print(actor)

#end of program

see attachment for the program screenshot and output

5 0
3 years ago
ANSWER QUICKLY PLEASE
DochEvi [55]

Explanation:

I don't know what is the question.

? should have the value of 4

binary digit 10000011 is equal to 128 plus 2 plus 1 = 131 in decimal

3 0
4 years ago
Web browsers are used to browse the world wide web.
VikaD [51]
No its actually used for looking up concerns, questions, or rumours
3 0
4 years ago
Read 2 more answers
Other questions:
  • A ___________ is used when an extra digit is added to a coded field to make sure it the entered data is correct (like social sec
    14·1 answer
  • Which key removes all data from an active cell with one click? A. Esc B. Delete C. Tab D. F2
    9·2 answers
  • Under the Right to Know Rule, employers need to include information on which one of the following in a written and complete haza
    5·1 answer
  • How do you make your graphics ADA accessible in BlueGriffon?
    12·2 answers
  • Jenny, a programmer, uses Microsoft Excel 2016 to generate data required for the programs she develops. She uses various functio
    10·1 answer
  • . Write a C++ Code to get a multiline statement Str1 from a user with a ‘$’ as return character (Hint:
    6·1 answer
  • Which is known as accurate processing of computer gigo E mail MHz bug​
    5·2 answers
  • Example of vector image format​
    12·1 answer
  • Does survey monkey remembers you already took survey?
    8·1 answer
  • The specialized programs used by the operating systems to help ensure that memory is used properly and there are no memory confl
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!