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
Why is the yellow light blinking on the front of my computer
Yanka [14]

Answer:

that means it needs to get charged or it's on airplane mode not sure what else it could be

6 0
3 years ago
What is a good analogy for explaining the actions of a compiler?
kozerog [31]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

This question is about what is a good analogy for explaining the actions of a compiler?  The correct option is <u> automatic programming of kitchen devices .</u>

<u> </u>

a hybrid ability of a car to use multiple energy sources  (false)

this analogy is not correctly mapped on the compiler, becuase the compiler can be designed only for one type of language, for example, the program that calculates the average of students number can be easily programmed in C++ and in C#. But you cannot compile the C# program in C++ compiler and vice versa.  

a street map of a local subdivision  (false)

Because you can design a compiler for a not specific subdivision of programming.

an interpreter who speaks several languages

it is not an analogy, however, an interpreter can handle only one type of language.

an automatic programming of kitchen devices (true)

This is a good analogy of compiler because you give input to the device and that device based on your input gives you back an output. Similarly, you give input to the compiler in form of language syntax, and it automatically give you output based on your input.

3 0
3 years ago
Play station account
Reika [66]
I have a PlayStation as well
4 0
3 years ago
Read 2 more answers
1.
Vlad1618 [11]
A. Since it tells about how people think she’s lesser because she’s a women.
7 0
3 years ago
What is an aptitude assessment that matches students with study programs at specific colleges and universities?
melisa1 [442]
I think the correct answer would be FOCUS2. It is a system that guides members in choosing college or a major. It provides a starting point for students who are not yet certain of what they want to take academically. Hope this helps.
5 0
3 years ago
Read 2 more answers
Other questions:
  • explain the key reasons why entity relationship modeling is important, and determine at least (1) way in which it impacts the ov
    5·1 answer
  • Please Do Solve it guys...
    6·1 answer
  • Which cost of purchasing a franchise would you still have if you start your own business​
    12·1 answer
  • Relation between training and occupation with examples in points . Plz tell fast<br> ​
    5·1 answer
  • What term is used to refer to the merging of government services with information technology?
    11·1 answer
  • Assume that sentence is a variable that has been associated with a string consisting of words separated by single space characte
    12·2 answers
  • We will create a shopping cart, it is a dictionary mapping items in the car to the amount of that item. For example if there is
    9·1 answer
  • What facilitates the automation and management of business processes and controls the movement of work through the business proc
    9·1 answer
  • 6. kinukuha nito ang kabuuang bilang ng mga numerical na datos sa mga piniling cells
    12·1 answer
  • Which part of the computer is responsible for managing memory allocation for all applications
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!