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

The angle between the forces 30N and 20N action a body of mass 10kg is 120°. Find the acceleration of the body​
what is the scale factor from abc to def
12. Examine the punctuation (commas, colons, hyphens, and quotation marks) in each sentence. Then, choose Correct or Incorrect.
12(y+2 =6(2y+4 is that infinite,one or no solution
does anyone have a narrative/creative essay about 'making a hard decision' ?
Which of the following occurred with the advent of radio
what is an equation of the line that passes through the points -5,-5 and -5,5 write your answer in the simplest form.
HI I need help with this question in IXL
Which explicit formula is equivalent to a1= 1/3, an=an-1+1
Why should you slow down below the speed limit and turn on hazard lights as you exit a highway to pull over? * PLEASE HELP PLEASE!!!!!!!!!!!!