I am doing some exercises, and I am a beginner in python. Doing some coding challenge and there was an exercise that tells me I should ask my name, and it should show me how many letters my name has.
My first solution was:
name = "What is your Name?"
print("Your Name has: " + len(name) + " Letters.")
It showed me an error.
Why was my first solution wrong? I mean, I learned a bit of Java it's a bit different, but shouldn't it normally print it out?
Would be nice if someone had different solutions or maybe a little answer for me.
Would be awesome, thanks.
I changed the len(name) into str(len(name)).
name = "What is your Name?"
print("Your Name has: " + str(len(name)) + " Letters.")
that worked.
but why my first solution didn't worked?