def presses(phrase):
i = 0
for char in phrase.upper():
if char in '1ADGJMPTW*#':
i += 1
if char.isspace() == True:
i += 1
if char in 'BEHKNQUX0':
i += 2
if char in 'CFILORVY':
i += 3
if char in '23456S8Z':
i += 4
if char in '79':
i += 5
return i
I've recently completed a python puzzle in an attempt to better my scripting ;however, I've tried turning my loop into a comprehension, but I'm having trouble doing this because of all the conditionals. Can anyone help me try and turn this loop into a comprehension?