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
olga nikolaevna [1]
2 years ago
10

Your task is to implement a function replace_once(t, d), that takes a text t and a replacement dictionary d, and returns the res

ult of replacing words according to the dictionary: if a word appears as a key, replace it with the dictionary value, and if a word does not appear in the dictionary, leave it alone.
Given a list of words, you can concatenate them together with spaces in between as follows:
word_list = "I love eating bananas".split()
print("Word list:", word_list)
back_together = " ".join(word_list)
print("Back together:", back_together)
# You can also join them in other ways, btw. Just DON'T do it for this homework.
print("You can also put commas:", ", ".join(word_list))
Computers and Technology
1 answer:
djverab [1.8K]2 years ago
4 0

Answer:

Explanation:

The following code is written in Python and does exactly as requested. It is a function named replace_one(t, d) that takes the two parameters one text/word and one dictionary. If the word is found as a key in the dictionary it places the value in a variable called new_word and returns it to the user, if it is not found then the function returns nothing.

def replace_once(t, d):

   if t in d:

       new_word = d.get(t)

       return new_word

   return

You might be interested in
A hard drive that is running slowly may not have been
Anuta_ua [19.1K]
Plugged in i think is the answer
7 0
3 years ago
Read 2 more answers
a printer's accessory list includes a maintenance kit with a variety of replaceable parts you should install after 100,000 pages
Triss [41]

Answer:

Laser printer

Explanation:

This is a guess based on experience, but laser printers have rollers, drums, and other various parts that need periodic replacement.

See page 87 of https://www.laserpros.com/img/manuals/hp-manuals/hp-lj-4100-manual.pdf for an example.

4 0
2 years ago
Help me pls!!! last question
monitta

Answer:

tina.left(90)

Explanation:

In code if you want your character to turn left you put "left" in your code and if you want your character to go right type "right" and so on and so on so your answer is tina.left(90)

8 0
3 years ago
What is blockchain? How it works? I heard bitcoin uses it.
igor_vitrenko [27]
Https://www.toptal.com/bitcoin/blockchain-technology-powering-bitcoin
i dont have the time to read it right now, but i was able to find you this link that should hopefully help- you out!
6 0
3 years ago
Why is weather forecast so important for hang gliders?
professor190 [17]
Well, it wouldn't be such a good idea if they got caught up in a storm, would it? :p

Strong winds could blow them off-course, or even lightning has a chance of striking the hand glider, causing damage to the glider, the person, or even both.

Additionally, a weather forecast can help in my generic situations. For example, knowing whether to wrap up warm for cold weather, or wear something a bit more loose and breathable for hot weather.
6 0
3 years ago
Other questions:
  • I WILL MARK BRAINLIEST PLZ HELP
    5·1 answer
  • The development of various technologies led to many historic events. Use information from the Internet to describe one major his
    7·1 answer
  • 7.2 need help plzs 15 points
    13·1 answer
  • What is the way to discover requirments for software projects ?
    14·1 answer
  • 7.5 Code practice Plz answer ASAP
    15·1 answer
  • Name:
    11·1 answer
  • Most C++ catastrophe vulnerabilities rely on uninitialized function pointers in a class.
    13·1 answer
  • Someone please make a random question with an easy answer because i need one more brainliest to UPGRADE!
    7·2 answers
  • You were recently hired by a small start-up company. The company is in a small office and has several remote employees. You have
    15·1 answer
  • Send link for a qc or paddle
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!