TheAlgorithms/Python

Incorrect format code 'c' used for string in min_cost_string_conversion.py

Closed this issue · 2 comments

Repository commit

NA

Python version (python --version)

Python 3.12.1

Dependencies version (pip freeze)

altair==5.3.0
anyio==4.3.0
asttokens==2.4.1
attrs==23.2.0
blinker==1.8.1
cachetools==5.3.3
certifi==2024.2.2
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
comm==0.2.1
contourpy==1.2.0
cycler==0.12.1
debugpy==1.8.0
decorator==5.1.1
editdistance==0.8.1
efficientnet==1.0.0
essential-generators==1.0
et-xmlfile==1.1.0
executing==2.0.1
Flask==3.0.3
Flask-Cors==4.0.1
fonttools==4.49.0
gitdb==4.0.11
GitPython==3.1.43
h11==0.14.0
h5py==3.10.0
httpcore==1.0.5
httpx==0.27.0
idna==3.7
imageio==2.34.0
imgaug==0.4.0
ipykernel==6.29.0
ipython==8.20.0
itsdangerous==2.2.0
jedi==0.19.1
Jinja2==3.1.3
jsonschema==4.22.0
jsonschema-specifications==2023.12.1
jupyter_client==8.6.0
jupyter_core==5.7.1
Keras-Applications==1.0.8
keras-ocr==0.9.3
kiwisolver==1.4.5
lazy_loader==0.3
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.8.3
matplotlib-inline==0.1.6
mdurl==0.1.2
nest-asyncio==1.6.0
networkx==3.2.1
numpy==2.1.1
opencv-python==4.9.0.80
openpyxl==3.1.3
packaging==23.2
pandas==2.2.2
parso==0.8.3
pillow==10.2.0
pip==24.1.2
platformdirs==4.1.0
plotly==5.18.0
prompt-toolkit==3.0.43
protobuf==4.25.3
psutil==5.9.8
pure-eval==0.2.2
pyarrow==16.0.0
pyclipper==1.3.0.post5
pydeck==0.9.0
Pygments==2.17.2
pyparsing==3.1.1
pypng==0.20220715.0
python-dateutil==2.8.2
pytz==2023.3.post1
pywin32==306
pyzmq==25.1.2
qrcode==7.4.2
referencing==0.35.1
requests==2.31.0
rich==13.7.1
rpds-py==0.18.0
scikit-image==0.22.0
scipy==1.12.0
setuptools==70.3.0
shapely==2.0.3
six==1.16.0
smmap==5.0.1
sniffio==1.3.1
stack-data==0.6.3
tenacity==8.2.3
tifffile==2024.2.12
toml==0.10.2
toolz==0.12.1
tornado==6.4
tqdm==4.66.2
traitlets==5.14.1
typing_extensions==4.11.0
tzdata==2023.4
urllib3==2.2.1
uvicorn==0.30.1
validators==0.22.0
waitress==3.0.0
watchdog==4.0.0
wcwidth==0.2.13
Werkzeug==3.0.3

Expected behavior

The function performs string conversion operations without formatting errors.

Actual behavior

While running the compute_transform_tables function in the min_cost_string_conversion.py script, the following error occurs:

ValueError: Unknown format code 'c' for object of type 'str'

I'm not sure why the c modifier is there in the code since it doesn't seem to be a valid format code.

This really is something that we should've caught much earlier, but I guess we didn't notice since the code didn't have any unit tests and thus wasn't being run in our workflows. Thanks for the catch!

My pleasure !