Skip to main content

ASCII

 In Python, the chr() function can be used to convert an ASCII ordinal number to a character (the ord() function does the opposite).

  • ASCII characters can be represented as decimal numbers as shown in this table.

Solution

def ascii(list):  
flag = ""
for i in list:
asciiChar = chr(i)
flag += asciiChar
print(f"{flag}")

if __name__ == '__main__':
list = [99, 114, 121, 112, 116, 111, 123, 65, 83, 67, 73, 73, 95, 112, 114, 49, 110, 116, 52, 98, 108, 51, 125]
ascii(list)
list = [99, 114, 121, 112, 116, 111, 123, 65, 83, 67, 73, 73, 95, 112, 114, 49, 110, 116, 52, 98, 108, 51, 125] 
flag = ""
for i in list:
asciiChar = chr(i)
flag += asciiChar
print(f"{flag}")