Изменения в новых версиях / Python 3.13

# note: everything below needs Python 3.13 or newer. The bank runs
# Python 3.12, where this is not there yet.

import random

# *** before: ***
# a file of our own named like a module of the standard library shadowed
# it, and the message said only that the attribute is missing:
#
#   AttributeError: module 'random' has no attribute 'randint'
#
# the cause - our own random.py lying next to the script - had to be
# guessed. Tracebacks were printed in one colour, so in a long chain the
# line that actually failed did not stand out

# *** in version 3.13: ***
# the message names the file and says what to do with it:
#
#   AttributeError: module 'random' has no attribute 'randint'
#   (consider renaming '/home/me/random.py' since it has the same name as
#    the standard library module named 'random' and prevents importing
#    that standard library module)
#
# an import from such a file is explained the same way, and a traceback is
# coloured by default: the place of the error and the message are picked
# out, which matters most in a long chain of calls

print(random.randint(15))