Using ArcGIS Field Calculator to change text to digit? [duplicate]

I am using ArcGIS Desktop 10.6.

I have one field that is titled SEVERITY, and is string type, and has words like "Medium" "Low" "High," etc. I would like to assign a number to correspond with the word ("1" for "Low", 2 for "Medium," etc.), and to have that populate in a new field.

I've created the new field, called it "SEVERITY_CODE" and made it an integer. All I need to do is use the field calculator to say "look at the SEVERITY column, and translate that into numbers for the "SEVERITY_CODE" column but I cannot seem to find it. The solutions I've found on the web are not helping.

Can anyone help with this?

marked as duplicate by PolyGeo♦Nov 18 '18 at 4:25

def calc(SEVERITY_CODE):