Does the word "act" have the same definition in the next two sentences?

She wants to act Lady Macbeth, but she is too young for the role.

He acted the idiot.
different meanings