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

Trade spread through the Italian Renaissance across Europe by
In a right triangle, he measure of one acute angle is 3 times the sum of the other acute angle and 8, Find the measure of angle 1 and 2
Ms. Green tells you that a right triangle has a hypotenuse of 13 and a leg of 5. Find the other leg of the triangle
Hay muchos _____ en el museo?
between which bond is ATP stored in glucose
what are the six principles in the preamble
True or false? a strong protocol should be detailed enough that the entire methods section of any paper that will result from the project could be written befor
What is one of the 10 rights of medication administration?
why was it difficult to maintain a kingdom in the conquered lands?
Abeka: American Literature Appendix Quiz N English 11 The Scarlet Letter 1. What was the holiday? 2. what did hester tell pearl that dimmesdale would probably d