Why this code isn’t running successfully?

Here is the simple code but I can’t run! My code is:

name = input("What is your name? ")
print("My name is "+name+". "+"My name length is " + len(str(name)))

and Output is:

What is your name? Ali
Traceback (most recent call last):
  File "c:UsersiamAlDesktopPythonmain.py", line 2, in <module> 
    print("My name is "+name+". "+"My name length is " + len(str(name)))
TypeError: can only concatenate str (not "int") to str

Answer

If you want to print a number you should use , insted of +, in this case len() returns an int so if you want to print the string length you should first convert it to a string.

I suggest using .format to print various type of data:

name = input("What is your name? ")
print("My name is {}. My name length is: {}".format(name,len(str(name))))