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
Create a dictionary that maps a fruit name to its color. Both the keys and the values should be stored as strings. Include only
UkoKoshka [18]

Answer:

Written in Python:

fruit_dictionary = {}

fruit_dictionary = {'apple': 'red', 'orange': 'orange', 'banana': 'yellow'}

Explanation:

First (although, not necessary), we create an empty dictionary named fruit_dictionary on line 1

Next, we populate the dictionary using the following syntax:

{key-1:value-1, key-2:value-2,......,key-n:value-n}

In this case, the entry would be:

{'apple': 'red',

'orange': 'orange',

'banana': 'yellow'}

The items on the first column (i.e. apple, orange and banana) are the keys while the items on the second (i.e. red, orange and yellow) are the values of the dictionary

To print the items in the dictionary, you can add  the following line of code:

<em>print(fruit_dictionary.items()) </em>

6 0
3 years ago
What is meant by the term text?
krek1111 [17]

Answer:

It's D

Explanation:

5 0
3 years ago
Read 2 more answers
How would you justify using cloud computing?
podryga [215]

Cloud Computing

Explanation:

1.Cloud computing allows employees to be more flexible in their work practices. For example, you have the ability to access data from home, on holiday, or via the commute to and from work (providing you have an internet connection).

2.Network capabilities are extended without requiring investment in new infrastructure, personnel, or software. Technology is integrated into every-day appliances allowing them to interconnect with other devices, making them more 'smart' or automated.

3.Cloud computing benefits

  • Efficiency / cost reduction. By using cloud infrastructure, you don't have to spend huge amounts of money on purchasing and maintaing equipment.
  • Data security.
  • Scalability.
  • Mobility.  
  • Disaster recovery..
  • Control.
  • Competitive edge.

4.Cloud environments promise several benefits such as reduced expenses and simplicity to ser- vice providers and service requesters [Foster et al. ... 2010], trust management and security are ranked among the top 10 obstacles for adopting cloud computing

6 0
3 years ago
In addition to developing sketches, computer-aided design programs are used by fashion designers to perform which task?
nikdorinn [45]

Answer:

flat drawing, pattern making development, computerized marker planning and many other fashion designing related aspects.

Explanation:

6 0
2 years ago
Multiple Intelligence Theory explains that...
Alex

Answer:

A. We all learn differently (edge 2020)

Explanation:

4 0
2 years ago
Read 2 more answers
Other questions:
  • Which of the following functions and expressions will convert the ASCII character "Z" to its numeric equivalent ASCII code?
    7·1 answer
  • ____________________ is the premeditated, politically motivated attacks against information, computer systems, computer programs
    6·2 answers
  • In steps<br> Urgent please
    14·1 answer
  • Jared does not update his computer’s system software. What threat does his computer face?
    9·1 answer
  • The 2 main types of copyright relevant to the recording industry?
    5·2 answers
  • Write an expression that will print "in high school" if the value of user_grade is between 9 and 12 (inclusive). Sample output w
    12·1 answer
  • Instructions:Select the correct answer.
    8·2 answers
  • It is an island country; it fought against us in World War II; it is known for sushi.
    14·2 answers
  • Why was it important for the date format to be standardized by the
    7·1 answer
  • Which of the following best describes a hotspot as
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!