About 52 results
Open links in new tab
  1. How to get the ASCII value of a character - Stack Overflow

    Oct 22, 2008 · Depending on the number of characters, it could be orders of magnitude faster than calling ord in a loop. To use it, wrap a string/character in a numpy array and view it as int, which …

  2. python - How do chr () and ord () relate to str and bytes? - Stack …

    ord() takes as input a single-character str and returns an int. The input is a str just like any other str in Python 3. In particular, it is not bytes encoded in some specific Unicode format like UTF-8, rather it …

  3. python - What does ord (c) and chr (n) do and what does this code ...

    Aug 14, 2019 · Look up what ord (gets a asciis integer value) and chr (turns integer values back into charcters) do. As it sits the code is just grabbing the next ascii character (a becomes b). Btw in the …

  4. python - What does the name of the ord () function stand for? - Stack ...

    May 13, 2018 · The official Python documentation explains ord(c) ord (c): Given a string representing one Unicode character, return an integer representing the Unicode code point of that character. For …

  5. python - using ord function (ord (B [0]) - ord ('0')) - Stack Overflow

    So ord(B[0]) - ord('0') is the int 1 when B[0] is the string '1', and it is the int 0 when B[0] is the string '0'. In short, it is just a way to convert the string to an int. int(B[0]) would have been simpler, but the author …

  6. python - functionality of function ord () - Stack Overflow

    2 ord is a function that takes a character and returns the number that unicode associates that character with. The way unicode structures the digits 0-9 ord("9")-ord("0") will result in 9. ord of 0 is 48 and the …

  7. Caesar Cipher Function in Python - Stack Overflow

    Jan 17, 2012 · I'm trying to create a simple Caesar Cipher function in Python that shifts letters based on input from the user and creates a final, new string at the end. The only problem is that the final cipher...

  8. python - Usage of ord ('q') and 0xFF - Stack Overflow

    Nov 18, 2018 · ord('q') returns the Unicode code point of q cv2.waitkey(1) returns a 32-bit integer corresponding to the pressed key & 0xFF is a bit mask which sets the left 24 bits to zero, because …

  9. python - How to convert string to binary? - Stack Overflow

    Oct 3, 2022 · I am in need of a way to get the binary representation of a string in python. e.g. st = "hello world" toBinary(st) Is there a module of some neat way of doing this?

  10. string - Alphabet range in Python - Stack Overflow

    Jul 17, 2022 · In Python 3, use string.ascii_lowercase. But this returns a string. In case you need a list, I think, Bg1850 is a neat solution