Ask Question

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

+1
Answers (1)
  1. 12 August, 06:52
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “in python Write a loop that counts the number of lowercase characters that appear in the string referenced by mystring. ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers