inglecindy3184 inglecindy3184
  • 02-01-2020
  • Computers and Technology
contestada

in python Write a loop that counts the number of lowercase characters that appear in the string referenced by mystring.

Respuesta :

ijeggs
ijeggs ijeggs
  • 03-01-2020

Answer:

mystring = "My name is David Acheme"

count = 0

for i in mystring:

    if(i.islower()):

        count=count+1

print("The number of lowercase characters in: "+mystring)

print(count)

Explanation:

1. We declare a String Variable and assign a value.

2. Intialize a count variable to zero.

3. Using a for loop is to loop through each characters in the string.

4. The if condition checks when a lower case character is encountered using the islower method and increases count by 1

5. Prints the value of count.

Answer Link

Otras preguntas

texas is one of the nations leading producers of all the following energy sorces except
What’s the answer???
44.24 to 1 decimal point
1. For calculating work, the force and the distance must be in the same
How much producer biomass is supported in the ecosystem?
Someone please help out! Really need to pass :(
Who is the first one attacked by Odysseus, what is that individual doing as he is attacked?
The diagram shows boat B speeding in the direction of boat A. Boat A is anchored to the bottom of the lake. What could happen if boat B bumps into boat A? A. B
Watkins Elementary School is painting the desks. Each desk takes 1/3 of a liter of paint. If the school buys 6liters of paint, how many desks can they paint? Wh
Before Roman artists were influenced by the Greeks they drew inspiration from theEtruscans.TrueFalse​