What will following Python code
return?
str1="Stack of books
print(len(str1))
13
14
15
16
Answers
Answered by
1
Answer:
After correcting the code a bit to:
The output will be 14.
Explanation:
Python counts space between string as a character.
Answered by
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
English,
2 months ago
Biology,
2 months ago
Science,
5 months ago
English,
5 months ago
Business Studies,
11 months ago
India Languages,
11 months ago