- 3

How to use the ASCII table on python interpreter

10th Jun 2022, 11:52 PM
Kwanele Buhle
Kwanele Buhle - avatar
6 Antworten
+ 4
Kwanele Buhle , since you are talking about python, i can give you a short and rough overview how this is handled for this language. (1) output of the 2 strings word1='AAB' word2='BC' (2) mem. location of these strings -> they are different mem. location of the strings: id(word1)=541490806832 mem. location of the strings: id(word2)=541490806960 (3) mem. location of the chars of the string -> word1. you can see that the duplicated char 'A' have the same location, so they share the memory mem. location of the char of word1 id(char)=541491829104 => A <= mem. location of the char of word1 id(char)=541491829104 => A <= mem. location of the char of word1 id(char)=541492079728 => B <* (4) mem. location of the chars of the string -> word2. and SURPRISINGLY the mem. location of the char 'B' also share memory with the same char but from an different string mem. location of the char of word2 id(char)=541492079728 => B <* mem. location of the char of word2 id(char)=541492079600 => C [Program finished]
11th Jun 2022, 11:06 AM
Lothar
Lothar - avatar
+ 3
Pls elaborate. Use how?
11th Jun 2022, 12:48 AM
Emerson Prado
Emerson Prado - avatar
+ 3
Please specify Python in your post's tags for improved language context clarity https://code.sololearn.com/W3uiji9X28C1/?ref=app
11th Jun 2022, 1:37 AM
Ipang
11th Jun 2022, 2:14 AM
BroFar
BroFar - avatar
+ 1
Kwanele Buhle Well, the representation would be exactly the ASCII numbers for B and C, respectively. What's the question?
11th Jun 2022, 4:50 AM
Emerson Prado
Emerson Prado - avatar
- 2
For example if this is the question "Consider the string ‘BC’. What would be its representation in the memory of a computer, assuming that ASCII/UNICODE is used? And the answer is required in hexadecimal
11th Jun 2022, 1:08 AM
Kwanele Buhle
Kwanele Buhle - avatar