Portugal has invested greatly in its public transportation network and all of the larger cities are connected by trains. Lisbon and Porto both have an efficient and reliable metro system which is your best option for exploring the town. Buses are also widely available and you might even get a 40% discount if you book your ticket at one of the yellow Carris booths in Lisbon.