Q:

Print the ASCII value of the enter key

How should I print the ASCII value of the "enter" key in Python? I have tried ord() but it doesn't seem to work for the "enter" keyword. It works for other keywords and characters.

A:

You need to use \n (Line Feed) or \r: (Carriage Return).
>>> ord('\n')
10
>>> ord('\r')
13

as you can see, they are 10 and 13 respectively.
11 is Vertical Tab and 12 is Form Feed.

