converting chr() / ord() with multi characters
<p>beginner programming in python (3.4)<br>
is it possible to pass multiple values inside chr() and ord()?
what i tried is the following:</p>

<pre><code>userInput = input('Please write your input: ')
&gt; Hello
result = ord(userInput) #here is the error because i put multiple values instead of just one
print(result)
</code></pre>

<p>this is the output i am looking for: <code>72 101 108 108 111</code> (hello) but instead i get an error telling me i can only pass 1 character/value inside chr() / ord()
is this possible? if not can you provide me in the right direction? thank you</p>

<p>You could use a list comprehension to apply <code>ord</code> to every character of the string, and then join them to get the result you're looking for:</p>

<pre><code>result = " ".join([str(ord(x)) for x in userInput])
</code></pre>

python