This is the formula that i have to apply in the problem. Is the lambda a constant?
$$E=2K_o\frac{\lambda}{r}$$
Yes, the charge per unit length, $\lambda$, has to be uniform for this formula to hold. If it weren't uniform, the lack of symmetry would not permit this formula to be derived from Gauss' Law. However, the value of $\lambda$ can differ between problems.