“了”often be used at the end of a sentence. It sometimes works as particlea,to indicate that sth new had happened. when it goes after a verb or an adjctive,it means the action or the change had been complicated."I drank 3 bottles of water" means 我喝了三杯水 in Chinese,it means the action of drinking has been done.so it is the later sentence我看了一部电影。Both two sentences indicate that you have had finished your action.