CodeSolved

A comprehensive source of programming questions and exercises

The string of the string

Practice Easy 22/ Download 1208 Views

Write a function to receive a string (String) and return the number of letters

Note: To solve this question, you should not use ready -made functions


Example:

get_len('code-bezan.ir') # 13

11 Answers

This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
# In the following function does not calculate the distance as letters and if we want to calculate we must erase the condition
def get_len(par):
    lenght = 0
    for i in par:
        if i == ' ':
            pass
        else:
            lenght += 1
    return lenght
a = 'this is a test'
print(get_len(a))
def toolstr(n):
    x = len(n)
    return f"tooll reshete string: {x}"
print((toolstr(n=str(input("enter your tool string:")))))
def Shomarande(n) :
     count = 0
     for i in n :
          count += 1
     return count

Arshia.a Download Python
def get_len(string):
    index = 0
    while len(string) > index:
        print(index + len(string))
        break
while True:
    i = input("string: ")
    get_len(i)
Nima1393 Download Python
def string_len():
    x = input()
    print(len(x))
string_len()
User 1829 Download Python
a=input('word:')
def func(a):
    return len(a)
res=func(a)
User 887 Download Python
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

Related content

Detection using AI
×
×
Close