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
The top 3 most popular male names of 2017 are Oliver, Declan, and Henry according to babynames.
Naddik [55]

Answer:

#Set of three most popular names in 2007

male_names =  {'Oliver', 'Declan', 'Henry'}

#The male_names set is displayed to the user

print(male_names)

#The name to be removed is accepted from the user as a string

remove_name = str(input("Enter name to remove: "))

#The name to be added is accepted from the user as a string

add_name = str(input("Enter name to add: "))

#The remove method of a set is use to remove the received remove_name

male_names.remove(remove_name)

#The add method of a set is use to add the received add_name

male_names.add(add_name)

#The new set of male_names is displayed to the user

print(male_names)

Explanation:

4 0
3 years ago
Which three steps might be included in an algorithm for a digital thermostat?
chubhunter [2.5K]

Answer:

Explanation:

It certainly isn't D. It would cost a fortune to make that happen. It's not impossibe. Just impractical.

It's not A. Resistance is a floating physical thing present in the air.

B could be correct, but there is a better answer.

The answer is C. A thermistor is a resistance that is temperature sensitive.

7 0
2 years ago
_____ is an advanced optical disc technology that can store up to 3.9 terabytes, roughly 75–150 times more data than the Blu-ray
Anettt [7]

Answer:

"The holographic versatile disc".

Explanation:

According to my research on optical disk technology, I can say that based on the information provided within the question the technology being described in the question is called a "The holographic versatile disc".

Unfortunately it is not shown as an available answer but it is the correct answer. This is the only optical disk technology capable of holding 3.9 terabytes of data as well as meeting the specs mentioned in the question.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

7 0
3 years ago
Realizar una lista de las herramientas manuales que se utilizan en carpintería y otra en herrería, dibuja cada una de ellas y ex
alisha [4.7K]

Answer:

En carpintería se utilizan martillo, cinta métrica, escuadras, niveles de burbuja, navaja, herramientas de marcado, destornilladores y sierra circular.

Explicación:

Las herramientas manuales utilizadas en carpintería son martillos, cinta métrica, escuadras, niveles de burbuja, navaja, herramientas de marcado, destornilladores y sierras circulares, etc. Con martillos se pueden unir dos piezas de madera. La cinta métrica se utiliza para medir. Las herramientas manuales que se utilizan para la herrería son martillos de mano, mazos, cinceles, punzones, punzones y una selección de tenazas con brocas, etc. Estas herramientas se utilizan para cambiar la forma después de estar blandas debido al calentamiento.

4 0
3 years ago
Write a program that plays the popular scissor-rock-paper game. (A scissor can cut a paper, a rock can break a scissor, and a pa
Andrei [34K]

Answer:

Explanation:

The following program is written in Python and follows all the instructions accordingly to create the rock paper scissor game as requested.

from random import randint

answers = ["Scissors", "Rock", "Paper"]

computer = answers[randint(0, 2)]

continue_loop = False

while continue_loop == False:

   

   player_choice = input("Choose a number, 0 = Scissors, 1 = Rock , 2 = Paper?")

   player_choice = answers[int(player_choice)]

   if player_choice == computer:

       print("Tie!")

   elif player_choice == "Rock":

       if computer == "Paper":

           print("You lose!", computer, "covers", player_choice)

       else:

           print("You win!", player_choice, "smashes", computer)

   elif player_choice == "Paper":

       if computer == "Scissors":

           print("You lose!", computer, "cut", player_choice)

       else:

           print("You win!", player_choice, "covers", computer)

   elif player_choice == "Scissors":

       if computer == "Rock":

           print("You lose...", computer, "smashes", player_choice)

       else:

           print("You win!", player_choice, "cut", computer)

   else:

       print("That's not a valid play. Check your spelling!")

   continue_or_not = input("Would you like to play again? Y/N")

   continue_or_not = continue_or_not.lower()

   if continue_or_not != "y":

       break

   computer = answers[randint(0, 2)]

8 0
3 years ago
Other questions:
  • Tricia listed her assets and liabilities. Credit Card Bill Car Loan Bonds Piano Bank Account Bicycle Which are Tricia’s liabilit
    8·2 answers
  • The type of meter used to test downstream digital signal quality
    12·1 answer
  • What is the most common way for computing systems and devices to authenticate a person’s identity? citi
    10·1 answer
  • A technology company only hires applicants who are under the age of 30. This company could face possibly _________ consequences
    9·2 answers
  • Which of the following software costs money?
    6·2 answers
  • Whats 400000 time 93823
    14·2 answers
  • Suppose that a main method encounters the statement t3.join(); Suppose that thread t3's run() method has completed running. What
    15·1 answer
  • Importancia de la química en la vida cotidiana​
    15·1 answer
  • What do we do if IOC is called on the intercom ??
    14·1 answer
  • General Electric saves $1.6 billion per year by using its private corporate network that links its 340,000 employees. Another na
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!