Str function

Hey! I am working on the medical insurance project within the python syntax lesson. For it we have to make an integer value that is comprised of integers as well as referenced values. From that, we then have to print the result, but are told to do so using the str() phrase. This is where my question comes from, why? What condition makes it necessary to use the srt() phrase? What is its purpose?

If you have a query about a specific lesson then please include a link to that lesson and provide a minimal example of your problem if possible (make sure to format any code you submit to the forums). The following FAQ contains useful guidance about this-

In many cases you can print various data types in Python without converting them to a string. Is it perhaps necessary because you are combining different data types together? For example what should 3 + "3" evaluate to… 6"33"?

1 Like