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

Combustion reaction all follow a similar pattern, complete the work equation below Hydrocarbon + ... ---> Carbon... + ....
What type of color is achieved when mixing red and orange a. Primary color b. Secondary color c. Tertiary color d. None of the above
how the media coverage of political events (campaigns)
Which of the following starts with a contradiction of what you are trying to prove? a. contrapositive inference b. direct proof c. indirect proof d. negatio
What was a guiding principle of the New Deal economic policies?
A chemical equation is a representation of a chemical reaction. a. True b. False
6. Identify each measurement that is approximatelyequivalent to 24 inches.60 cm30 cm5 cm2 ft
the layer of the atmosphere where most of our weather occurs is called
Sketch the graph of the equation: [tex] x^{2} + y^{2} - 22x = 0 [/tex]
Which of the following statements about physiological age and chronological age is TRUE? a. Physiological age and chronological age are always the same. b. Ph