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

What is an advantage of a single-celled organism? A. It can become very large. B. It can reproduce quickly. C. It does not have to maintain its struct
the spinning jenny reduced the number of workers necessary to
When prey produce so many offspring in a short period of time that predators can attack only a fraction of them, it is referred to as:?
What does the scene in the throne room tell you about each of the three friends: Annabeth, Grover, and Percy?
Who was allowed to participate in Athenian democracy? a) wives of citizens b) foreign-born residents c) men whose fathers had been citizens d) slaves who ha
what may breastfeeding lessen the risk of in the mother A. breast cancer B. diabetes C. hypertension D. high cholesterol
Which statement best describes the term insurance?
write the answer as a decimal fraction 14/100=? /10+? /100=?
A number of systems for pumping ions across membranes are powered by atp. such atp-powered pumps are often called atpases, although they do not often hydrolyze
why were the spanish interested in the lands north of mexico