1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sauron [17]
3 years ago
5

write a function solution that given an integer n returns a string consisting of n lowercase lettersn

Computers and Technology
1 answer:
melomori [17]3 years ago
3 0

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.
You might be interested in
Briefly explain five measures you have undertaken to protect your confidential
Gnom [1K]

Answer:

by putting it in old fashioned password box

Explanation:

I I think I should say so that's a good person is not able to go see guys place where there's a nice specifically said that it must be old fashioned lunch boxes I don't usually be opened

5 0
4 years ago
IBC Question: You are writing a JavaScript program for Blue Yonder Airlines. The program stores various information about the ai
prohojiy [21]

Answer:

Explanation: you know its 1 a 2 a 3c 4D 5E

4 0
3 years ago
How much do taxis coast?
Novay_Z [31]
It depends on how far you travel

3 0
3 years ago
Read 2 more answers
The oldest "computer" is thought to be how old? please help i beggiging 20 points
igomit [66]
The oldest “computer” is2,000 years old.

5 0
3 years ago
Read 2 more answers
Using an outline, how do you maintain your computer or cellphone​
daser333 [38]

Answer:

  1. well first things first be good to your battery.
  2. get padded protection of your laptop.
  3. disable programs you don't use.

6 0
3 years ago
Other questions:
  • based on the transcript, what did broadcasting the story through the medium of radio allow welles to do?
    8·1 answer
  • If you are installing separate anti-virus and anti-spyware programs, which should you install first
    7·1 answer
  • 11.19 LAB: Max magnitude Write a function max_magnitude() with two integer input parameters that returns the largest magnitude v
    7·1 answer
  • How does soil lose its value? A.When the top soil is stripped by wind or water B.When the bedrock is damaged by animals C.When w
    15·1 answer
  • Describe how data center storage applications drive the development of SAN technology.
    8·1 answer
  • Which of the following statements about the break statement is false? Group of answer choices Common uses of the break statement
    12·1 answer
  • What is the purpose of a transistor?
    13·2 answers
  • Write down a scratch program which:
    5·1 answer
  • Java Eclipse homework. I need help coding this
    6·1 answer
  • Which function works best when you need to remove an element at a specific index in a list?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!