I am learning DSP and I couldn’t write a code to calculate and plot these figures (just magnitude of Hanning and triangular windows in frequency domain.) Could anyone please help me with the code?

I’ve read something related to online FFT, and, for example, they calculate online FFT with 1024 time steps. I don’t understand what is 1024 time steps, and what are the influences of time step value to FFT analysis?
I hope the following piece of code is helpful to you.
Annotation:
You can put
win1andwin2as Time-series signal.Lis the length ofwin1orwin2.nfftis the length of FFT . ifL < nfft, then the functionfft()will add0to the rest ofnfft. IfL > nfft, then the functionfft()will interception the length ofLto equalnfft.