Why doesn’t parrot have quotes around it when being printed?
Answer
While it wouldn’t be invalid to type len("parrot"), it would not be equivalent to len(parrot). To print a variable, we don’t wrap it in quotes, we just write the name of the variable, and it provides whatever is contained inside of it to the len( ) method. The difference would be “parrot” instead of "Norwegian Blue".
For a better understanding, check out the code below:
my_bird = "penguin"
print my_bird # prints “penguin” to the screen
print "my_bird" # prints “my_bird” to the screen
Hello. I do not understand how 14 is the len of “Norwegian Blue”. When I count the text starting at N = 0 I am coming up with 12 not including the space between the words. Are the quotations included in the len?