DEV Community

Discussion on: Ultimate Python Cheat Sheet

Collapse
python_jobs_online profile image
Python Jobs Online

Great work!

Some suggestions for improvement:

  1. int('21.99') won't convert it to an integer. It will raise a ValueError. To convert the string of 21.99 to an int, you need to do this int(float('21.99')), which will result in 21

  2. MAX_USER = 100 isn't a "const" data type. Constants are a concept vs a data type

  3. You could expand the data types to include another very common Python data structure, the good old tuple. e.g. (1,2,3,4). Plus, you may also want to include sets, e.g. {1, 2, 3}

I didn't read any further, but thought I'd point out those couple of quick items that I noticed.

All the best