Answer:
- custom_encoded = ""
- custom_message = "this is a pen"
- custom_encoding = {
- "a": "1",
- "e": "2",
- "i": "3",
- "o": "4",
- "u": "5"
- }
-
- for c in custom_message:
- if(c in custom_encoding):
- custom_encoded = custom_encoded + custom_encoding[c]
- else:
- custom_encoded = custom_encoded + c
-
- 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
Answer:
A stack data structure should be used. The time complexity of the insert, delete minimum and maximum operation is O(1).
Explanation:
The stack data structure is an indexed structure that holds data in an easily retrievable way. Data is held in a first-in last-out method as elements in the structure are popped out from the end of the stack when retrieved sequentially.
The worst-case time complexity of getting the minimum and maximum elements in a stack and deleting it is O(1), this is also true for inserting elements in the stack data structure.
Answer:
GIF
Explanation:
The Graphic Interchange Format (GIF) is the image format that supports small animations made out of sequential frames played in sequence and possibly in loops, depending on the parameters saved in the file.
The Animated GIFs are seen everywhere these days on social medias, where people use them to express their emotions in bigger and more elaborate ways then emoticons.
Reliable sources state that Americans whom use social media have a better overall sense of community. Social media is beneficial to the overall mental stability of Americans when it comes to community
Answer:
maybe you need to reload the page and press the little bell on the right side and u should get a notification when somebody answers your question and if that doesnt help go to your profile and press the tab (on this tab if that makes since) it should say sumin like questions you asked and u should press the ones u need the answers to
Explanation:
lmk if this helped