How can you know if you have penile cancer?

If there are. Changes to the appearance of the penis including mass, skin discoloration, pain then see your doctor.