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]
3 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]3 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
Which of these is NOT an example of lifelong learning?
oee [108]

Answer:

B. having lunch with a friend

Explanation:

Lifelong learning can be defined as a continuous, self-motivated, and self-initiated learning activity that is typically focused on personal or professional development. Thus, it's a form of education that is undertaken throughout life with the sole aim of pursuing knowledge, competencies, and skills for either personal or professional growth and development, especially after acquiring a formal education.

Some examples of lifelong learning includes the following;

I. Reading a trade magazine.

II. Reviewing a textbook.

III. Studying an encyclopedia.

7 0
3 years ago
The type of line shown below represents an / a:​
VikaD [51]

Answer:

esrfsrtg

Explanation:

6 0
3 years ago
Anyone have Minecraft dungeons I need help with it
steposvetlana [31]

Answer:

for sure add me upppp its mypplong

5 0
3 years ago
Read 2 more answers
Many people dream of being successful, but their actions can sometimes hold them back. What are some ways you can be sure that y
Nikitich [7]

Answer:

  • make a promise
  • write it in a diary
  • make a scrap book
  • create a video
  • make a picture book

I hope this helps

<h2>I know you will do great!!!</h2>

5 0
3 years ago
Which rule should be followed to stay safe online?
anyanavicka [17]

Answer:

Avoid sharing photos with anyone online.

Explanation:

People can track you down. Its not worth to be kidnapped. Stay safe.

4 0
3 years ago
Other questions:
  • The view side by side command is used to view and ________ two workbooks at one time
    10·1 answer
  • Suzy lives alone in New York, whereas her family lives in Florida. It is difficult for Suzy to visit her family very frequently,
    12·2 answers
  • Which of the following are documents that can help you to review and assess your organization’s status and state of security? Fi
    6·1 answer
  • In Access, it is possible to have _______________ fields, that is, fields that can contain more than one value.
    9·1 answer
  • How do you add Rulers to a document?: *
    6·1 answer
  • Select the correct answer.
    10·1 answer
  • Consider the following code segment.
    12·1 answer
  • marianne needs to create a version of her slide presentation that does not include all the slides and will be used for a particu
    9·1 answer
  • Please answer me <br> in Assignment - Algorithms
    10·1 answer
  • Instructions
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!