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 something like this: tt = 5 while (tt--): # do something It is exists in C++. And in my opinion it is very Pythonic _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/GRIWCDQL7AZCOSF3RVEYU2KVFYYBDRBF/ Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/RRGE4BABCSY2JHSVNLDEM5ANA2GMW6QT/ Code of Conduct: http://python.org/psf/codeofconduct/