Closed bnavigator closed 4 months ago
https://docs.python.org/3.12/library/random.html#random.randrange:
Changed in version 3.12: Automatic conversion of non-integer types is no longer supported. Calls such as randrange(10.0) and randrange(Fraction(10, 1)) now raise a TypeError.
Operating system: openSUSE Tumbleweed rpmbuild wxPython version & source: 4.2.1 sdist from PyPI, lightly patched Python version & source: openSUSE Tumbleweed python312 rpm
Description of the problem:
Python 3.12 does not accept floats for
random.randint()
anymore.Code Example (click to expand)
```python Python 3.11.6 (main, Nov 15 2023, 09:22:27) [GCC] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import random >>> random.randint(1, 20/2) 10 >>> 20/2 10.0 ``` ```python Python 3.12.1 (main, Dec 15 2023, 10:49:50) [GCC] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import random >>> random.randint(1,20/2) Traceback (most recent call last): File "