Answer:
Following are the method to this question:
def solution(s):#defining a method solution
x=0#defining variable x that assign value 0
for i in s:#defining for loop to count string value in number
if(i.islower()):#defining if block that check input character is in lowercase
x=x+1#increment the value of x by 1
return x#return x
s=input("Enter string:")#defining s variable that input string value
print(solution(s))#defining print method to solution method
Output:
Enter string:Database is the colloection
22
Explanation:
In the given question some data is missing, that's why we define the answer as follows:
- In the above code, a solution method is defined, which takes "s" variable as the parameter, and inside the method, an integer variable "x" is defined, that holds a value that is "0".
- In the next line, for loop is declared, that counts string value without space and inside the loop, if block is defined, that checks only the lowercase character and adds the value in x variable, and returns its value.
- Outside the method s variable is defined, that inputs the string value from the user end, and use the print method to call it and print its calculated value.