Learning to Code

Yes, that is correct: state.clear()