Computer Science, asked by shivangisudha, 5 months ago

write a program to find first 10 natural numbers in python by using for loop​

Answers

Answered by Oreki
9

\textsf{\large One-Liner}

   \texttt{print(*[i for i in range(1, 11)])}

\textsf{\large Detailed}

   \texttt{for i in range(1, 11):}

       \texttt{print(i, end=' ')}

\textsf{\large Algorithm}

  • \textsf{\small Using the \textbf{for} lo \hspace{-.34em}op to iterate over the range and print numbers in the range.}
Similar questions