Why str(len(menu))?


I was wondering what was the purpose of str in line 12 str(len(menu)) ? And why it would not work with out str?

Sorry I know it is quite obvious but I am new to coding.


One reason might be concatenation. We cannoit concatenate an integer to a string. len(menu)) is an integer. Converting to a string permits concatenation and/or string representation in formatting.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.