So if I am understanding this correctly, in the list comprehension you want to use the value 0
if the letter is a space, otherwise you want to use ord(lett) - 96
. You can use a conditional expression to express this logic as follows:
0 if lett == ' ' else ord(lett) - 96
Putting this into the comprehension:
lettconv = [0 if lett == ' ' else ord(lett) - 96 for lett in msg]