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
Using powerpoint 2016, ethan develops a short five-slide presentation for his marketing project. â â powerpoint files consist of
Lady bird [3.3K]
b. Ribbons  - Powerpoint 2016 has a tabbed ribbon system that groups relevant menus together according to category. The ribbon contains a number of tabs, each having a separate group of commands. The tabs can be used to do most of the common tasks in Powerpoint.
8 0
3 years ago
Can someone help: how to get binary?
xxTIMURxx [149]

Answer:

Explanation:

SENN KİMSİİİİİİİİN???

8 0
2 years ago
Read 2 more answers
g What differences do you anticipate there being between working inside vs outside City government in data and digital services?
Ivanshal [37]

Answer:

The work with city government is better than outside city government due to the reasons given below.

Explanation:

There are many differences while working in city government or outside city government. I choose city government job in data and digital service due to the following reasons.

  1. City government provides all types of facilities that are required in data management and digital services.
  2. Provision of more benefits along with salary from city government.
  3. City government arrange different training and development sessions for their employ.
  4. There are many learning and development opportunities, because they provide opportunity to work in different departments.  
  5. City Government have better HR policies as compared to outside government.
6 0
3 years ago
Files and folders in UNIX can be removed using the
wel

<em>Files and folders in UNIX can be removed using the</em>  <u><em>rm command.</em></u>

<em>The answer is B. rm command </em>

<em>Hope this helps :)</em>

3 0
3 years ago
A method variable a class variable with the same name. a) acquiesces to b) destroys c) overrides d) alters
arlik [135]

Answer:

Option(c) is the correct answer for the given question.

Explanation:

The method variable overrides the class variable name with same name The method variable overrides of the class variable name .

Following are the example in java language

public class Main

{

int b=90; // class varaible or instance varaible

void sum()

{

   int b=34; // method having same name as class varaible name

   b=b+10;

   System.out.println(b); // display b

}

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

{

 Main ob=new Main(); // craete object

 ob.sum(); // calling method sum

}

}

Output:

44

In this we declared a variable 'b' as int type in class and override this variable in sum() function it means same variable name is declared in function sum() .

acquiesces ,destroys,alters are the wrong for the given question.

So overrides is the correct answer

4 0
3 years ago
Other questions:
  • The faster the film (the higher the ISO), the more visible its grain. When you are using higher ISO, you are not just bringing g
    5·2 answers
  • "Server Manager will allow you to manage all roles and features installed on any server, and view the status of all your servers
    7·1 answer
  • Your task in this assignment is to exploit the race condition vulnerability in the above set-uid program. more specifically, you
    14·1 answer
  • How often are computer and user policies applied after a user has logged into a computer?
    15·1 answer
  • Does coaxial cable use radio waves to transmit data
    10·2 answers
  • Websites can have good content for a particular set of search phrases, yet rank poorly. Issues that may cause this to occur incl
    9·1 answer
  • Where do you define parameter variables?
    14·1 answer
  • Why do we need to make a plan before actions?
    7·1 answer
  • ---------------------- use of the Internet to access programs and data on computers that are not owned and managed by the user o
    9·1 answer
  • How will you maintain electrical tools and equipment?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!