subject
Computers and Technology, 28.05.2021 14:00 kat9940

ASCII-Encoded String Many simple encoding methods have been devised over the years. A common method is the ASCII character set used to display characters on the screen. Each character is given a numeric value which can be interpreted by the computer. 
In this challenge, you will be given a string to decode. An example of an encoded string follows The table below shows the conversion from the string Hacker Rank to the ASCI string 729799107202114328297110107
Characteri aici P r e p I n s t a
ASCII Vai 97 99 107 101 11432 82 97 110 107
We then reverse the ASCII string to get the encoded string 701011792823411101701997927
To decode the string, first reverse the string of digits, then successively pick valid values from the string and convert them to their ASCII equivalents. Some of the values will have two digits, and others three. Use the ranges of valid values when decoding the string of digits. 
For reference, the characters in s correspond to the following ASCII values:
The value range for A through Z is 65 through 90.
The value range for a through z is 97 through 122.
The value of the space character is 32.
Function Description
Complete the function decode in the editor below. The function must return the original decoded string.
decode has the following parameteris
encoded an encoded string
Constraints
.1 <= |s| <= 105
. s[i] ∈ {}
Sample Input 0
23511011501782351112179911801562340 161171141148
Sample Output 0
Truth Always wins
Explanation 0
We reverse encoded to get 8411411711610432651082 1532 We then replace each ASCII Value with its corresponding character:
Python
num = input()
num = num[::-1]
Final_string = ''
number = ''
for i in range(len(num)):
number = number + num[i]
if (int(number) >= 65 and int(number) <= 90) or (int(number) >= 97 and int(number) <= 122) or (int(number) == 32):
character = chr(int(number))
Final_string+=character
number = ''
print(Final_string)
Output:
23511011501782351112179911801562340 161171141148
Truth Always Wins

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Which is produced by the endocrine system to control how cells and organs function
Answers: 2
question
Computers and Technology, 22.06.2019 12:50
You have just been hired as an information security engineer for a large, multi-international corporation. unfortunately, your company has suffered multiple security breaches that have threatened customers' trust in the fact that their confidential data and financial assets are private and secured. credit-card information was compromised by an attack that infiltrated the network through a vulnerable wireless connection within the organization. the other breach was an inside job where personal data was stolen because of weak access-control policies within the organization that allowed an unauthorized individual access to valuable data. your job is to develop a risk-management policy that addresses the two security breaches and how to mitigate these risks.requirementswrite a brief description of the case study. it requires two to three pages, based upon the apa style of writing. use transition words; a thesis statement; an introduction, body, and conclusion; and a reference page with at least two references. use a double-spaced, arial font, size 12.
Answers: 1
question
Computers and Technology, 24.06.2019 06:30
For which utilities, if any, does the landlord pay?
Answers: 2
question
Computers and Technology, 24.06.2019 12:00
What is a sketch or blueprint of a web page that shows the structure (but not the detailed design) of basic page elements such as the logo, navigation, content, and footer?
Answers: 3
You know the right answer?
ASCII-Encoded String Many simple encoding methods have been devised over the years. A common method...
Questions