chr() is a function in Python or PHP which returns the character (string of length one) that corresponds to an ASCII code point.
Questions tagged [chr]
166 questions
0
votes
1 answer
Python ord() and chr()
I have:
txt = input('What is your sentence? ')
list = [0]*128
for x in txt:
list[ord(x)] += 1
for x in list:
if x >= 1:
print(chr(list.index(x)) * x)
As per my understanding this should just output every letter in a…

YoCozy
- 1
- 1
0
votes
1 answer
Batch Convert Columns from chr to num with either read_excel or dplyr
I have a database saved in excel, and when I bring it into R there are many columns that should be numeric, but they get listed as characters. I know that in read_excel I can specify each column format using the col_types = "numeric", but I have >…

Erin Giles
- 73
- 6
0
votes
1 answer
parsing with CHR (Constraint handling rules)
Trying to do sort of parsing with CHR (Constraint handling rules)
I come up with this (still learning)
w(the),w(X) <=> w([the,X]).
w(L),w(on),w(R) <=> w(on(L,R)).
w(L),w(is),w(R) <=> w(is(L,R)).
here is what i got :
?-…

sten
- 7,028
- 9
- 41
- 63
0
votes
1 answer
Trying to transcribe using ascii values using ord and chr
Trying to make an encrypter that shifts ascii values of each character in a message by the value of a corresponding character in a password - Output always results in either a single character or a string index out of range error:
msg = input()
pw =…

nonpt
- 1
0
votes
1 answer
Why does the following code not output the corresponding letters correctly?
Why does the following code not output the corresponding letters correctly?
It outputs number to letter is['\x03', '\x03']
final_numbers = [3, 3]
final_letters = []
for i in range(len(final_numbers)):
print(i)
…

Benjamin McDowell
- 166
- 1
- 9
0
votes
1 answer
Python3 replace ord() and chr()
for i in word:
c = ord(i) - int(key)
if c < 97:
c = c + 26
b = chr(c)
text += b
Is there another way to replace this without ord() and chr()?
Thank you very much!

jack hu
- 13
- 5
0
votes
0 answers
I can't add tab to string In SSIS vb script task.Tab somehow got replaced with spaces
I've SQL Server Integration Services package with script task which create formatted string for message body. I use StringBuilder which appends text, appends Tabs (Chr(9)) and appends lines to format message. But when i assign final StringBuilder…

Anatolys
- 11
- 1
- 2
0
votes
1 answer
Python caesar cipher how to decode a specific sentence?
I am trying to decode enciphered message 'lmnopqrstuvwxyzabcdefghijk'. I got that it shifted by 11 and I must decipher 'I wtvp olel decfnefcpd lyo lwrzctesxd'.
Here's what I wrote so far:
#enciphered message = 'I wtvp olel decfnefcpd lyo lwrzctenter…

basicPythonhelp
- 1
- 2
0
votes
1 answer
Chr (169) not giving copyright symbol
I have an mdb split FE and BE which on my Windows 10 / Office 365 Acess is giving © for Chr(169).
On my client's machine (recent update to Windows 10) with Office 2013, Access is giving � (Actually, in the Immediate window it looks a 1 with an…

HMcGoonish
- 57
- 7
0
votes
1 answer
wshShell.SendKeys(Chr(&hAF)) doesn't work
The wshShell.SendKeys(Chr(&hAF)) which should turn up the volume doens't work.
The other 2 commands (sendkeys for Chr(&hAE) and Chr(&hAD)) works perfect.
But these commands are useless if you can't turn the volume up but only turn it down.
I have…

Alex
- 11
- 1
- 2
0
votes
1 answer
php hextobin not works exactly in c#
I have following php code , I can't write c# code which exactly work as php. Looks there different encodings. I need write c# code which gives result as php code
My php code
echo hexbin('246439589af7f1d84eb638c995687d53');
function…

Kamil Ibadov
- 1,436
- 2
- 20
- 44
0
votes
1 answer
carriage return in Access 2000
I have 2 Access databases, both are Access 2000 both are copies of each other. But when I copy text to the one table it enters correctly as displayed below.
1st line
2nd Line
3rd Line
When I enter the same data to the second table, it is…

user3818712
- 13
- 4
0
votes
2 answers
Capitalizing each words with chr and ord
First I have to receive a string from the user. The function would be capitalizing the introduced string object. It would make the words start with uppercased characters and all remaining characters have lower case. Here is what I did:
ssplit =…

Ch138
- 5
- 2
0
votes
1 answer
use function names in perl's map
I was playing with this piece of code to print a list of chars:
perl -e 'print join(" ", map { sprintf "%02x", ord } grep /\s/, map { chr } 0x0 .. 0x7F )'
Is there a easier way to write map { chr } 0x0 .. 0x7F ?
I've tried:
map \&chr 0x0 ..…
user12104832
0
votes
2 answers
Is there any specific reason why the chr function won't accept a higher answer?
Does anybody know if there is a specific reason why the chr function throws an error if I enter a number higher than 1114111?
EG:
>>> chr(1114111)
'\U0010ffff'
>>> chr(1114112)
Traceback (most recent call last):
File "", line 1, in
…
user11771557