Ask Question
24 September, 07:51

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

+3
Answers (1)
  1. 24 September, 11:14
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers