Computer Science, asked by adithyan42556, 10 months ago

Write a Python program to find the length of the string.

Answers

Answered by BrainlySmile
1

Answer- The above question is from the chapter 'Introduction to Python'.

Python-

Python is a simple programming language.

It has been created by Guido van Rossum and launched in 1991.

Its features make it easy to understand and this language is used a lot in the big companies and industries.

Given question: Write a Python program to find the length of the string.

Answer: Method 1:- Using loop.

Method 2:- Using len( ) function.

(See the following attachments.)

Attachments:
Answered by BeautifulWitch
3

Answer:

Input:

# User inputs the string and it gets stored in variable str

str = input("Enter a string: ")

# counter variable to count the character in a string

counter = 0

for s in str:

counter = counter+1

print("Length of the input string is:", counter)

Explanation:

Hope this helps you ✌️

Attachments:
Similar questions