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
ki77a [65]
4 years ago
6

A) How could you modify Shelve with a technique discussed in class so that you can create Shelve instances that contain // Tools

, Dishes or any other kind of object? // B) Create a function that takes in two shelves
Computers and Technology
1 answer:
Kay [80]4 years ago
3 0

Answer:

See explanation

Explanation:

A “shelf” is a dictionary-like object. A shelf is an arbitrary Python objects, that is; anything that the pickle module can handle. This includes recursive data types and objects containing lots of shared sub-objects. It must be noted that the keys are ordinary strings.

(A). modification to Shelve can be done by following this instructions;

(1). Do not redefine built-in functions,(2). grab shelved item, mutate item, write mutated item back to shelf.

The number (2) instructions is during iteration over shelved items.

(B). CREATING FUNCTIONS THAT TAKES IN TWO SHELVES;

import shelve

d = shelve.open(filename) # open -- file may get suffix added by low-level

# library

d[key] = data # store data at key (overwrites old data if

# using an existing key)

data = d[key] # retrieve a COPY of data at key (raise KeyError if no

# such key)

del d[key] # delete data stored at key (raises KeyError

# if no such key)

flag = key in d # true if the key exists

klist = list(d.keys()) # a list of all existing keys (slow!)

# or, d=shelve.open(filename,writeback=True) would let you just code

# d['xx'].append(5) and have it work as expected, BUT it would also

# consume more memory and make the d.close() operation slower.

d.close() # close it

You might be interested in
Which library research databases include information about articles published in magazines, journals, and newspapers? question 1
Alecsey [184]

Answer:

periodical databases

Explanation:

Among the various databases you can now access in a library, the periodical databases contains the text and other information about articles published in magazines, journal and newspapers.

This database allows you for example to easily search for all articles written about a specific event or person, and it will return you the list of articles you can then read from a single spot, no matter where or when the article was written.

8 0
3 years ago
The digital revolution has affected a. almost all areas of movie-making, except makeup and hairstyling. b. only a small number o
Georgia [21]

Answer:

Option D is correct.

Explanation:

The Digital Revolution applies to technological improvements from optical automated and mechanical machines to that of the digital technology that is currently accessible. The era began well into the year of 1980s, and continues. That Digital Revolution still marked as the start of the Era of Info.

  • It's the evolution of electrical and analog to digital technologies.
  • Its the advent of digital technologies has also altered the manner of people communication.
  • The following things are only done through computers, cellphones, as well as the web.
5 0
3 years ago
The following equations estimate the calories burned when exercising (source): Men: Calories = ( (Age x 0.2017) — (Weight x 0.09
sammy [17]

In python:

age = float(input("How old are you? "))

weight = float(input("How much do you weigh? "))

heart_rate = float(input("What's your heart rate? "))

time = float(input("What's the time? "))

print("The calories burned for men is {}, and the calories burned for women is {}.".format(

   ((age * 0.2017) - (weight * 0.09036) + (heart_rate * 0.6309) - 55.0969) * (time / 4.184),

   ((age * 0.074) - (weight * 0.05741) + (heart_rate * 0.4472) - 20.4022) * (time / 4.184)))

This is the program.

When you enter 49 155 148 60, the output is:

The calories burned for men is 489.77724665391963, and the calories burned for women is 580.939531548757.

Round to whatever you desire.

6 0
3 years ago
Curtis has been testing a new software package for the past two months. However, he decides not to switch and goes back to using
hodyreva [135]
Retro-active interference
8 0
4 years ago
A married man gets a new job in a company. After three months, he meets a younger woman in the finance department and they begin
pav-90 [236]

Answer:

False ( B )

Explanation:

Of  the seven IT  infrastructure domains The USER domain was not at risk because the User Domain is not task with handling the sharing of data or Mutual communication between users in a Typical IT infrastructure.

The domain charged with such responsibility is The LAN domain because the LAN domain is charged with the sharing of information between the USERS and maintaining good mutual communication, and since the relationship has become sour, the sharing of information between the users will suffer the most and it will be at a high risk

5 0
3 years ago
Other questions:
  • How do smart watches affect the business and its position in the global marketplace?
    12·2 answers
  • How did the discovery of glossopteris support wegner's continental drift hypothesis?
    15·1 answer
  • Explain why testing can only detect the presence of errors, not their absence.
    14·1 answer
  • You would like to search for information about storms but not tornadoes. What type of search strategy may be useful?
    10·2 answers
  • Consider the following code segment. int[] seq = {3, 1, 8, 4, 2, 5}; for (int k = 1; k < seq.length; k++) { if (seq[k] >=
    5·1 answer
  • What is the difference between word processing software and email?
    12·2 answers
  • The parts of a memo are _____.
    9·2 answers
  • Define global variables called highestNum, userInput and sumOfNums and initialize them. In Main call 2 methods: 1) UserData() 2)
    5·1 answer
  • Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    12·1 answer
  • Why do we need to learn about engineering and technology?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!