[Python-ideas] Re: while(tt--)

2023-08-04 Thread Niktar Lirik via Python-ideas
Hi Daniil. Yes, you can do almost same:     tt = 5     while tt := tt - 1:     print(tt) 04.08.2023 9:18, daniil.arashkev...@gmail.com пишет: Currently in Python we have construction like this: tt = 5 while t: # do something tt -= 1 It would be great if in Python we have somet

[Python-ideas] Re: while(tt--)

2023-08-04 Thread Simão Afonso
I'm not sure if you are trolling, but why not use "range"? Can't get more Pythonic than that. -- *Powertools Technologies, Lda* R. Alves Redol 9 * 1000-029 Lisboa * Portugal Phone: +351 214 009 555 * GPS: 38°44'10.927"N 9°8'26.757"W E-mail: cont...@powertools-tech.com * https://www.powertool

[Python-ideas] while(tt--)

2023-08-04 Thread Daniil . arashkevich
Currently in Python we have construction like this: tt = 5 while t: # do something tt -= 1 It would be great if in Python we have something like this: tt = 5 while (tt--): # do something It is exists in C++. And in my opinion it is very Pythonic __