Questions tagged [chr]

chr() is a function in Python or PHP which returns the character (string of length one) that corresponds to an ASCII code point.

166 questions
1
vote
3 answers

Sum columns with a column as a chr type

I have something like this: Date Point1 Point2 Point3 01-03-2000 23 57 98 02-03-2000 67 36 77 03-03-2000 67 25 47 ... I wanna get the sum of each column with a function like colSums, but my first column it…
0
votes
4 answers

How do I convert a float matrix into integer matrix?

I have a 25 by 25 matrix looks like solution = array([[ 3, 14, 12, 6, 25, 19, 7, 21, 18, 16, 5, 24, 9, 10, 1, 13, 23, 4, 20, 8, 22, 11, 17, 15, 2], [ 2, 9, 19, 8, 13, 12, 20, 3, 10, 11, 17, 7, 23, 15,…
Eric Yuan
  • 1
  • 1
0
votes
1 answer

vba replace multiple Chr(xx) in one specific range

I have this segment in my code that I have to remove some characters from a range. Instead of looping through every character inside every single cell in the range, I could just use the .Replace method, right? Using regex is not an option. Dim…
Afonso Medeiros
  • 67
  • 1
  • 10
0
votes
0 answers

Caesar cipher in Python, exercise

I'm stuck in solving the following exercise: "*From the standard input you will get an integer n and a message encrypted by Caesar cipher (i.e. shifted by n letters down the alphabet). Decrypt the message and print it. Hint: Functions chr a ord,…
0
votes
1 answer

Character to Date

I am having some problems with changing dates from Excel (characters in R) into date in R. Knowing that I am using : as.Date(Data$Datum, "d%/m%/y%") But it returns NA NA NA.. And the date starts in Excel on : 1-1-2019 , but in R it shows : "43466" I…
A.A
  • 15
  • 3
0
votes
1 answer

How do you change a vector from CHR to INT in R?

New user of R here so forgive my ignorance but I've hit a bit of a bind! I am currently working on a data set called Q1 which has a column for Start_Time that is displaying HH:MM except its vector is CHR and not INT or NUM. I am currently trying to…
malcorl
  • 11
  • 1
0
votes
2 answers

python - Caesar cipher - decryption of string using ord() and chr()

Ceasar cipher encryption method. Using ord() and chr () to decrypt a string. If a value with the offset is < 32 or > 126 on the ASCII table it will loop back around to the appropriate value. However, it is not working 100%, skips over symbols from…
Infusion
  • 17
  • 5
0
votes
2 answers

Python - Increment last character in a String by 1

I've searched on how to do this in python and I can't find an answer. If you have a string: Value = Run1 How would you increment last digit in a string by 1? So the input that I'm looking for is: Value = Run2 I know I can do it with one character…
Vishal K
  • 11
  • 3
0
votes
0 answers

Ascii Values like 10(LF) and 127(DEL) Get Displayed Weirdly and the Output Changes in Different Applications like PyCharm, IDLE and Command Prompt

Whenever I try to print out the ascii values of for example DEC 127( : DEL) I get a box with a diagonal line means it doesn't get recognized but as soon as I copy these boxes and paste them into PyCharm(2021.2.3) I get the letters "DEL". Another…
Pixelbog
  • 236
  • 1
  • 8
0
votes
1 answer

Why can't I get more than 59 characters as output in this code?

I'm trying to create a code to train my python skills, it is a program that generates a random string with the alpha-num characters, by transforming them from the ASCII to characters, and then it will compare with the actual order of the normal…
0
votes
2 answers

How to put random.randint into a list

I'm having trouble trying to put a random.randint into my list and making it work so far I have this: strings = [str(chr(random.randint(65, 90))) % x for x in range(0, int(uppercase) + 1)] for string in strings: print(string) I…
0
votes
1 answer

how to print large numeric value to ascii using chr in perl

To generate ascii values and feed $bitmask I use: perl -E 'say chr 101' > value_ascii.txt My question comes up when I try to generate an ascii value for the number 1185644. That is, now I want the value of $bitmask to be the ascii value…
7beggars_nnnnm
  • 697
  • 3
  • 12
0
votes
0 answers

How to use print(chr(27) + "[2J")? input() function is not working properly when I use this print() function. Thank you

I am making HangMan game in Python. It is almost ready but when I use print(chr(27) + "[2J") to clear the console every time while loop runs, it clears but then my guess = input("Guess a letter") is not working. And when I comment it out it works…
Sherzod
  • 1
  • 1
0
votes
0 answers

How to decode a list a ords back to chrs in python

So I recently stumbled upon a profile of a user- https://stackoverflow.com/users/13717976/hamburger?tab=profile and there is a little quiz there on how to get his contact. I tried doing it but I was stuck at this part of the code- my_contact = [71,…
TrexCodes
  • 87
  • 5
0
votes
1 answer

Contains is unable to find VbTab & Chr

Contains is unable to find VbTab & Chr(...) Public Function GetBullet(Txt As String) As String GetBullet = "" If Txt.Contains(vbTab & Chr(149)) Then GetBullet = Chr(149) If Txt.Contains(vbTab & Chr(176)) Then GetBullet =…