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
What are five most important areas of the animal industry that involve science and technology?
BigorU [14]

Animal Health, Breeding, Meat Sanitation/Preservation, Feeding, Waste Disposal

3 0
3 years ago
What is the main purpose of a graphic organizer?
timama [110]
B. To organize information using shapes.
8 0
3 years ago
Read 2 more answers
Write the definition of a class Clock. The class has no constructors and three instance variables. One is of type int called hou
maksim [4K]

Answer:

Following are the program definition in the Java Programming Language.

//define a class

public class Clock

{

//set integer type variable and initialize value

private int hours=12;

//set boolean type variable and initialize value

private boolean isTicking=true;

//set integer type variable and initialize value

private Integer diff=5;

}

Explanation:

Following are the description of Code.

  • Firstly define a class "Clock" with the "private" access modifier.
  • Then,  set the integer data type variable "hours" with the "private" access modifier and assign value 12 in that class.
  • After that, set the boolean data type variable "isTicking" with the "private" access modifier and assign value "true".
  • Finally set Integer class variable "diff" with the the private access modifier and assign value 5.
3 0
2 years ago
Linux is: Select one: a. primarily concerned with the tasks of end users. b. designed for specific machines and specific micropr
ivann1987 [24]

Answer:

C. an example of open-source software.

Explanation:

open-source software is the type of software in which anyone can access, it can also be shared And modified by anyone simply because ita accessible to the public.

Hence and open source software's source code can be

inspected, enhanced and modified by anyone. A typical example is Linux.

7 0
3 years ago
________ are viruses that masquerade as useful programs or files. hydras spyware programs worms adware programs trojan horses
Harrizon [31]
Trojan horse is the correct answer
5 0
3 years ago
Other questions:
  • When reading data across the network (i.e. from a URL) in Python 3, what string method must be used to convert it to the interna
    9·1 answer
  • What block cipher mode of operation involves each ciphertext block being fed back into the encryption process to encrypt the nex
    12·1 answer
  • What are six external parts of a computer
    11·1 answer
  • Why was the term personal computer created?
    5·1 answer
  • Insert the components that the computer uses to perform the tasks of each of the parts:
    13·1 answer
  • What are lexical errors?<br> and fi(a==b)<br> will it be a lexical error or a syntactical error?
    8·1 answer
  • Is it important for a writer to include voice and point of view in writing because...<br> Plz help
    10·1 answer
  • A technician is building a thick client workstation that would be used to run a database and wants to ensure the best protection
    12·1 answer
  • ________ are the symbolic codes used in assembly language?​
    6·1 answer
  • Difference between copy command and cut command
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!