fork download
  1. list_word = ["hello", "bye"]
  2. list_ord = []
  3.  
  4.  
  5. def convert_to_ascii(text):
  6. return " ".join(str(ord(char)) for char in text)
  7.  
  8.  
  9. for i in list_word:
  10. list_ord.append(convert_to_ascii(i))
  11. print(list_ord)
Success #stdin #stdout 0s 9992KB
stdin
Standard input is empty
stdout
['104 101 108 108 111', '98 121 101']