Peru has a wide range of transportation, partly because having a car is expensive so most Peruvians don’t have cars. Public transport is plentiful and cheap but can be difficult if you don’t know Spanish.
I recommend renting a car with hesitation. Peru is not an easy country to drive in because of a general lack of drivers who follow traffic rules. I have rented a car at the Lima airport to drive to Paracas National Reserve, which worked well. However, driving in and out of Lima was difficult because of traffic and a lack of signs for directions.