Remember that a discrete signal has two directions of discreteness:
- limited duration in time: the number of samples you have
- limited sampling rate: the interval between each sample
The sampling rate will limit your maximum frequency via Nyquist, and the duration will limit the frequency resolution.
Your signal is composed of 62 samples, and of a duration of pi/9 ~ 0.348s, which gives you frequency bins for the
fft of 1/duration ~2.869 hZ.
As you can see from your graph, you don't have a frequency bin centred on 50Hz, but on 50.8hz (the 17th bin).
If you change your frequency in your signal definition to 50.8, you will see that the peak of the fft is much more pronounced (green squares for 50.8, blue circles for 50Hz), as it the signals fits better into the bins:
Of course, if you're measuring a real signal, you can't just change its frequency to match your bins. You can instead measure the signal for a longer time, so that the frequency resolution becomes greater, and the effects of the edges of the signal become less important. Here with a signal 9 times longer:
Another problem with DFT, is the effect of the start and stop of your signal, which can be reduced by multiplying with a Hamming window:
You can see that your peaks at 50 and 70 Hz are much more pronounced. Note that because the Hamming window has values between 0 and 1, the amplitude of your signal is reduced, so you need to divide the output of the fft by the mean of the Hamming window
You can also combine both techniques, use other types of windows.... See the links in the comment by OverLordGoldDragon above.