Urbaeloves7687 Urbaeloves7687
  • 21-11-2019
  • Computers and Technology
contestada

Define a Python function called leng_of_str to calculate the length of a string (Hint: Do not use the len function to find the length of string"" Use for loop to find the length of string.)

Respuesta :

dogacandu
dogacandu dogacandu
  • 22-11-2019

Answer:

The code is attached.

Explanation:

  1. the function accepts string as a parameter
  2. inside fuction there is a caunter variable initialized 0
  3. for every character in the string counter increases by 1
  4. returns final value of i as an integer, which is also the length of the string given

Ver imagen dogacandu
Answer Link

Otras preguntas

x+4y=4 in slope-intercept form
A dog breeder decides that he wants to make his chihuahuas smaller. He calls another breeder and borrows their smallest female chihuahua to breed with his smal
james has a card collection with 64 basketball cards, 32 football cards, and 24 baseball cards. he wants to arrange the cards in equal piles, with only one typ
Use examples from the lessons and your own personal experiences to compose at least one well-developed paragraph on the following: Define the term reserved pow
3,10,17,24,31,38 are composite
Samuel buys 3 3/4 feet of lumber for a shelf. The lumber costs $ 2.25 per pound how much did Samuel pay?
Which answer best describes the verb tenses in the sentence? While my dad brings the car around, I waited with the grocery cart. A. The verb tenses shift.
why was mecca a trade center for the arabian peninsula
Find the approximate solution of this system of equations. y = |x^2 − 3x + 1| y = x − 1
Which of these would be the most reliable source for a classroom presentation on "The Dangers of Texting and Driving"? an interview with someone who likes to te