0
len() function
message=input("Your text :") leng=len(message) print ("\nLenght:",leng) This program writing length symbols only befor space. Wats wrong ?
1 Answer
0
I am guessing that what you want to print out is "Length: (length of input)". If so, then the last line should say print ("Length: " + str(leng)). The print function does not take two arguments so what you need to do is concatenate strings. Since the len function returns an int, you will need to convert the variable leng from int to string using str.