Why can’t I do assignment outside a method?