CodeSolved

Solved Programming Questions & Exercises

The string of the string

Practice Easy 22/ Download 2100 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

15 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.
def counter(string):
    print('tool reshte barabr ast ba:\n',len(list(string)))
counter(string = input('yek reshte vared kon:\n'))
Amir.313 Download Python
def n(input_string):
    count = 0
    for character in input_string:
        count += 1
    return count
string =input("name:")
print(n(string))
# 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 get_len(s):
    count = 0
    for char in s:
        count += 1
    return count

# Example
print(get_len('code-bezan.ir'))  # 13
Ai Download Python
def toolstr(n):
    x = len(n)
    return f"tooll reshete string: {x}"
print((toolstr(n=str(input("enter your tool string:")))))
Sumy.amiri Download Python
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

×
×
Close