JustMika
JustMika

Reputation: 1

getting the ascii code of a sentence

I am trying to make a code that will give me the ascii code of a sentence, right now i can only give one letter

for example

a = input("c")

b = ord(a)

print (b)

it prints 99, my goal is to type abc with the outcome of 97 98 99

Upvotes: 0

Views: 284

Answers (1)

Nils Werner
Nils Werner

Reputation: 36765

Loop through a:

print([ord(c) for c in a])

Upvotes: 2

Related Questions