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
sasho [114]
3 years ago
6

Write a code block to encode strings from original messages, using our custom encoding. To do so: Initialize a variable called c

ustom_encoded as an empty string Use a for loop to loop across all characters of a presumed string variable called custom_message Inside the loop, check if the current character is in the custom_encodings dictionary If it is, use the current char to get the value from custom_encodings, and concatenate it to custom_encoded The line inside the if should look something like out = out + dictionary[char] Otherwise, concatenate the current character to custom_encoded
Computers and Technology
1 answer:
blondinia [14]3 years ago
3 0

Answer:

  1. custom_encoded = ""
  2. custom_message = "this is a pen"
  3. custom_encoding = {
  4.    "a": "1",
  5.    "e": "2",
  6.    "i": "3",
  7.    "o": "4",
  8.    "u": "5"
  9. }
  10. for c in custom_message:
  11.    if(c in custom_encoding):
  12.        custom_encoded = custom_encoded + custom_encoding[c]
  13.    else:
  14.        custom_encoded = custom_encoded + c
  15. print(custom_encoded)

Explanation:

The solution code is written in Python 3.

Let's define a variable custom_encoded with an empty string (Line 1).

Create another variable custom_message and set a sample string to it (Line 2).

Create one more variable custom_encoding to hold the mapping values between vowel and their respective encoded character (Line 3-9).

Create a for loop to loop through all the character in custom_message (Line 11) and in the loop check if the current character is found in custom_encoding dictionary, if so, use the current character to loop up the dictionary for the encoded value and add the encoded string to custom_encoded (Line 12-13). Otherwise, just add the current character to custom_encoded (Line 14-15).

At the end, print the custom_encoded to terminal and you shall get th3s 3s 1 p2n

You might be interested in
The theory of plate tectonics evolved from previous theories and concepts put forward by several scientists before its conceptio
BlackZzzverrR [31]

Answer:

I. Continental drift.

Hope this helps

4 0
3 years ago
Read 2 more answers
How can social media give you knowledge
cupoosta [38]
Social Media can you knowledge by most users on Social Media spreading their own knowledge.
5 0
3 years ago
To allow Hootsuite to reconnect to your LinkedIn account, you must first give authorization from the LinkedIn website
tekilochka [14]

Answer:

To allow Hoot suite to connect with my linked in account there are two ways.

  1. I just opened it in my browser.  If the browser is already signed in with linked in account then It directly access the account of linkedin.
  2. If there is no social media log in on browser then it requires authentication to login.
8 0
3 years ago
1. You have just finished installing a network adapter and booted up the system, installing the drivers. You open File Explorer
e-lub [12.9K]

Answer:

Check network discovery settings, check file sharing and firewall settings.

Explanation:

The first thing to check would be if the computer has network discovery active. Otherwise, even with a valid and working NIC, you won't be able to see it in any other computer across the network.

If that option is active, and the computer is not showing up, you can check the firewall settings, and if it's preventing you from accessing the network.

A third thing you could check on would be if the 2 computers are connected over wifi, you can try plugging them both via ethernet cable to your router, and test if there is an issue with wireless connectivity.

8 0
3 years ago
You add a style sheet link between which opening and closing tags?
Likurg_2 [28]

<link> tag

The <link> tag is most often used to link to external style sheets. The <link> element is an empty element, it contains attributes only.

8 0
3 years ago
Other questions:
  • A car moves down the street at 45 kph. The driver takes his foot off the gas pedal but does not brake. Which is the correct expl
    5·2 answers
  • In an open computer network such as the internet, hipaa requires the use of _____. in a closed system such as a local area netwo
    7·1 answer
  • Which kind of image is indispensable and needs added text to go with it? A. a map B. a chart C. a graph D. a photograph
    9·2 answers
  • The Blind carbon copy (Bcc) should be used when you want to __________.
    13·2 answers
  • Instructions (software) that allow a computer (hardware) to be used are written using specific symbols, letters and numbers know
    7·1 answer
  • 2. What is software conflict?<br>​
    11·1 answer
  • Select the correct answer.
    10·1 answer
  • Poob bn vbyfcfgxfc jghjg jhgh
    12·1 answer
  • 1:A presentation program which is developed by Microsoft
    12·2 answers
  • PLEASE HELP
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!