A question on Explicit String Conversion


#1

I am a beginner here and Python is the first programming language I've encountered. I still don't fully understand strings and non-strings.That's why in this Explicit Sting Conversion exercise, I don't understand why I must specifically use str() to convert a non-string to a string. Can I just use "3.14" instead of str(3.14)? If yes, is there any problems I might encounter in the future if I chose to use "3.14" instead?


#2

in this case you could indeed do "3.14", but codecademy has to start somewhere with teaching you string conversion. We could give a really complicated example where str() is a must, but that would be more confusing then helpful. Sometimes codecademy teaches a concept (like here)


#3

A post was split to a new topic: String conversion