How to properly key and run a subscript

Dear Forum,
When I keyed the following subscript expression into the script shell, it saved to a file and the IDLE shell appeared but did not run the expression:

data = 'myprogram.exe'
data[2]

When I copied and pasted it into the IDLE shell, one line at a time, the expression executed fine.

Any suggestions will be welcome.

What are you expecting data[2] to do?

If you want to print the value then you can write it as print(data[2]).

Tried your suggestion and it worked. Thanks for your help.