Hi Daniil.

Yes, you can do almost same:

    tt = 5
    while tt := tt - 1:
        print(tt)


04.08.2023 9:18, [email protected] пишет:
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 -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/GRIWCDQL7AZCOSF3RVEYU2KVFYYBDRBF/
Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/RRGE4BABCSY2JHSVNLDEM5ANA2GMW6QT/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to