Ask Question
4 May, 04:56

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

+1
Answers (1)
  1. 4 May, 08:13
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers