Computer Science, asked by akshaybhardwaj987154, 5 months ago

What will following Python code
return?
str1="Stack of books
print(len(str1))
13
14
15
16​

Answers

Answered by allysia
1

Answer:

After correcting the code a bit to:

\\\tt str1="Stack\ of\ books" \\\ttprint(len(str1))

The output will be 14.

Explanation:

Python counts space between string as a character.

Answered by chaudharyvikramc39sl
0

Answer:

The correct answer is 14.

Explanation:

Following Question is related to Python Programing.

Here "st1" is assigned a string "Stack of books"

Then the input is given with "print" with "len" tag.

Here

  • print = In python "print" command is used to display the output which came from the execution of the query or code that we have given to the idle.
  • len = "len" command is used to find the length of the string in python.

In this context the "len" command is giving the output which is the number of letters in the string including spaces.

So, the output is 14.

#SPJ2

Similar questions