[Tutor] Printing without a line feed

Narasimharao Nelluri narasimha928 at gmail.com
Thu Mar 25 02:29:52 EDT 2021


Hi Phil,

Let me does it help below code.

>>> for i in range(6):
...:     print(i,end=" ")
...: else:
...:     print()

0 1 2 3 4 5

Thanks
Narasimha

On Wed, Mar 24, 2021 at 10:29 PM Phil <phillor9 at gmail.com> wrote:

> Thank you for reading this.
>
> I want to print a range of numbers with a space between them but without
> a space at the end. For instance:
>
>      for i in range(6):
>          print(i, end=' ')
>
> How do I do this without the end space? I've spent hours on this even
> though I've managed to do what I want not long ago but I cannot remember
> how I did it. It's very frustrating.
>
> --
> Regards,
> Phil
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>


More information about the Tutor mailing list