Typescript Check If Variable Is String Mutable In Python