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
harina [27]
3 years ago
7

Python3

Computers and Technology
1 answer:
Tems11 [23]3 years ago
8 0

Answer:

Following are the program in the Python Programming Language:

def countLetter(words):

   #set dictionary

 di = {}

 for i in words: #set for loop

 #if key exists in di or not

   if di.get(i):

 #if exists count increased

     di[i] += 1

   else: #otherwise assign with key

     di[i] = 1

   # return di

 return di

def main():

 #get input from the user

 words = input("Enter the word: ")

 #store the output in function

 letter = countLetter(words)

 #set for loop

 for i in letter:

   print(i, ":", letter[i])  #print output with :

#call main method

if __name__ == "__main__":

 main()

Explanation:

Here, we define the function "countLetter()" and pass the argument "words" in parameter and inside it.

  • we set the dictionary data type variable "di".
  • we set the for loop and pass the condition inside it we set if statement and increment in di otherwise di is equal to 1.
  • we return the variable di.

Then, we define the function "main()" inside it.

  • we get input from the user in the variable "words".
  • we store the return value of function "countLetter()" in the variable "letter".
  • we set for loop to print the output.

Finally, we call the main method.

You might be interested in
Lower range tones generally require ________ speakers. lower range tones generally require ________ speakers. multiple choice
lilavasa [31]

Lower range tones generally require larger speakers.

It's no secret that lower range tones generally require larger speakers. This is because lower frequencies have longer wavelengths, and thus require more physical space to produce.

While this may seem like a simple concept, there are a few things to keep in mind when it comes to speaker size and low frequency response. First, larger speakers can usually reproduce lower frequencies more efficiently than smaller ones. Second, the size of the speaker's enclosure also plays a role in how well it can reproduce low frequencies.

A larger enclosure will typically have an easier time reproducing low frequencies than a smaller one.

Keep these things in mind when selecting speakers for your system. If you're looking for accurate low frequency reproduction, make sure to choose speakers with larger drivers and enclosures.

Learn more on speakers here:

brainly.com/question/14649463

#SPJ4

6 0
1 year ago
Create a class named Horse that contains the following data fields: name - of type String color - of type String birthYear - of
kozerog [31]

Answer:

The program to this question can be given as:

Program:

class Horse   //define class Horse

{  

private String name;   //define variables.

private String color;  

private int birthYear;  

//define set method.

public void setName(String name)  

{  

this.name = name; //set value of name.

}

public void setColor(String color)  

{  

this.color = color; //set value of color.  

}  

public void setBirthYear(int birthYear)

{  

this.birthYear = birthYear;  //set value of birthYear

}  

//define get method.

public String getName()  

{  

return name;  //return name.

}  

public String getColor()

{  

return color;  //return color.

}  

public int getBirthYear()

{  

return birthYear;  //return birthYear.

}  

}

class RaceHorse extends Horse     //define class RaceHorse  

{

private String raceNum;            //define variable.

public void setRace(String raceNum)    //define set method.

{

 this.raceNum=raceNum;      //set value of raceNum.

}

public String getRace()

{

 return raceNum;   //return raceNum

}

}

public class Main      //define main class.

{

public static void main(String[] args) //define main method.

{

 Horse ob= new Horse();  //creating class objects.

 RaceHorse ob1 = new RaceHorse();

 ob.setName("XXX");       //calling function

 ob.setColor("BLACK");

 ob.setBirthYear(2008);

 ob1.setRace("Five hundred meter");

 //print return values.

       System.out.println("The name of the horse is " + ob.getName()+"." +"\n"+  

   "The horse's color is " + ob.getColor()+"."+"\n"+ "It was born in " + ob.getBirthYear() +  

   "."+"\n"+ ob.getName()+" has taken part in " + ob1.getRace() + " races.");

   

}

}

Output:

The name of the horse is XXX.

The horse's color is BLACK.

It was born in 2008.

XXX has taken part in Five hundred meter races.

Explanation:

In the above program firstly we declare the class that is Horse in this class we define a variable that name is already given in the question which are name, color, and birthYear. In these variables are name and color datatype is string and the birthYear datatype is an integer because it stores the number. Then we use the get and set function in the get function we return all variable value. and in the set function, we set the values of the variable by this keyword. Then we declare another class that is RaceHorse this class inherit Horse class. In the RaceHorse class, we define a variable that is raceNum that's data type is a string in this class we also used the get and set function. Then we declare the main class in the main class we define the main method in the main method we create the above class object and call the set and get function and print the values of the function.

6 0
3 years ago
A _____________ is a piece of information sent to a function.<br> The answer is parameter :)
Firdavs [7]
The answer is argument.
3 0
3 years ago
What its the difference between Arduinos and Assembler?
Leno4ka [110]

Answer:

The Arduino boards can be programmed in assembly. All you need is an ICSP Cable (In Circuit Serial Programmer) and the AVR toolchain (free from ATMEL) to write to the board. You then get the advantage of on board debugging.

As you suggested, you can just slap an ATMEL chip on a breadboard and go to town.

Explanation: cause i said so

6 0
3 years ago
In a ____ network, each computer or device is connected to multiple (sometimes all of the other) devices on the network.
snow_tiger [21]
Simple. the answer is DOMAIN
5 0
3 years ago
Other questions:
  • ? Create a home page that introduces the rental car company. the page should have a header and footer. in the document body, it
    7·1 answer
  • A(n) _______ allows an attacker to use a network structure to send large volumes of packets to a victim.
    5·1 answer
  • Choose a developing country and give 3 reasons why it is a developing country ​
    15·1 answer
  • I analyze data, as a consultant, for companies making important business decisions. In order to get my point across, which of th
    11·1 answer
  • The _____ feature will allow users to view nonprinting formatting marks to aid in editing a document. View Alignment Show/Hide I
    12·1 answer
  • In Microsoft PowerPoint, a _____ gives viewers a visual image of data, such as a line graph or a three-
    12·1 answer
  • Suppose you are an ad-serving company and you maintain a log of cookie data for ads you serve to the Web pages for a particular
    14·1 answer
  • Help<br> pls need quickly
    9·1 answer
  • An electric spreadsheet can perform all of the following tasks, except
    6·1 answer
  • A company is looking for an employee to help organize customer information for the sales team. Which computer field includes thi
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!