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
galben [10]
3 years ago
15

Write a python program to apply this:

Engineering
1 answer:
lakkis [162]3 years ago
8 0

Answer:

# Initialize a dictionary with the keys

contestants = {"Darci Lynne":0, "Angelica Hale":0, "Angelina Green":0};

# Repeatedly prompt the user for a contestant name to vote for

while True:

 

  # Prompting user for contestant name

  cName = input("Enter contestant name to vote: ");

 

  # Checking for Done

  if cName.lower() == "done":

      break;

 

  # Checking in dictionary

  if cName in contestants.keys():

      # Updating vote value

      contestants[cName] += 1

  # New entry

  else:

      contestants[cName] = 1

 

# Printing header

print("\n%-20s %-15s\n" %("Contestant Name", "Votes Casted"))

# Printing results

for contestant in contestants:

  print("%-23s %-15d" %(contestant, contestants[contestant]))

You might be interested in
In details and step-by-step, show how you apply the Bubble Sort algorithm on the following list of values. Your answer should sh
astraxan [27]

( 12 17 18 19 25 )

<u>Explanation:</u>

<u>First Pass:</u>

( 19 18 25 17 12 ) –> ( 18 19 25 17 12 ), Here, algorithm compares the first two elements, and swaps since 19 > 18.

( 18 19 25 17 12 ) –> ( 18 19 25 17 12 ), Now, since these elements are already in order (25 > 19), algorithm does not swap them.

( 18 19 25 17 12 ) –> ( 18 19 17 25 12 ), Swap since 25 > 17

( 18 19 17 25 12 ) –> ( 18 19 17 12 25 ), Swap since 25 > 12

<u>Second Pass:</u>

( 18 19 17 12 25 ) –> ( 18 19 17 12 25 )

( 18 19 17 12 25 ) –> ( 18 17 19 12 25 ), Swap since 19 > 17

( 18 17 19 12 25 ) –> ( 18 17 12 19 25 ), Swap since 19 > 12

( 18 17 12 19 25 ) –> ( 18 17 12 19 25 )

<u>Third Pass:</u>

( 18 17 12 19 25 ) –> ( 17 18 12 19 25 ), Swap since 18 > 17

( 17 18 12 19 25 ) –> ( 17 12 18 19 25 ), Swap since 18 > 12

( 17 12 18 19 25 ) –> ( 17 12 18 19 25 )

( 17 12 18 19 25 ) –> ( 17 12 18 19 25 )

<u>Fourth Pass:</u>

( 17 12 18 19 25 ) –> ( 12 17 18 19 25 ), Swap since 17 > 12

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 ), Swap since 18 > 12

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 )

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 )

Now, the array is already sorted, but our algorithm does not know if it is completed. The algorithm needs one whole pass without any swap to know it is sorted.

<u>Fifth Pass:</u>

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 )

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 )

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 )

( 12 17 18 19 25 ) –> ( 12 17 18 19 25 )

6 0
3 years ago
What does WCS stand for? A. Western CAD System B. Worldwide Coordinate Sectors C. World Coordinate System D. Wrong CAD Settings
Ray Of Light [21]

Answer:

The correct answer is C. World Coordinate System

Explanation:

The World Coordinate System has to do with that coordinate system which is fixed in the activities of the CADing. There is a default system in which we can refer to them as soon as we want to manipulate the objects and add new elements.

7 0
3 years ago
Why is it important to stop climate change?
vampirchik [111]

Answer:

avoiding cutting down tree carelessy

Explanation:

people cutting down tree due to high population in order to find land for building this house so government should encourage people to have less children in the families and train them that when they are cutting trees should plants 10 tree inorder to recovery tree that is take off.

3 0
2 years ago
Read 2 more answers
The solid rod BC has a diameter of 30 mm and is made of an aluminum for which the allowable shearing stress is 25 MPa. Rod AB is
nexus9112 [7]

Answer:

The solid rod BC has a diameter of 30 mm and is made of an aluminum for which the allowable shearing stress is 25 MPa. Rod AB is hollow and has an outer diameter of 25 mm; it is made of a brass for which the allowable shearing stress is 50 MPa.

4 0
2 years ago
A sheet of steel 3-mm thick has nitrogen atomospheres on both sides at 900 C and is permitted to achieve a steady-state di usion
kati45 [8]

Answer:

X_B = 1.8 \times 10^{-3} m = 1.8 mm

Explanation:

Given data:

Diffusion constant for nitrogen is = 1.85\times 10^{-10} m^2/s

Diffusion flux = 1.0\times 10^{-7} kg/m^2-s

concentration of nitrogen at high presuure = 2 kg/m^3

location on which nitrogen  concentration is 0.5 kg/m^3   ......?

from fick's first law

J = D \frac{C_A C_B}{X_A X_B}

Take C_A as point  on which nitrogen concentration is 2 kg/m^3

x_B = X_A + D\frac{C_A -C_B}{J}

Assume X_A is zero at the surface

X_B = 0 + ( 12\times 10^{-11} ) \frac{2-0.5}{1\times 10^{-7}}

X_B = 1.8 \times 10^{-3} m = 1.8 mm

4 0
2 years ago
Other questions:
  • Air at 38°C and 97% relative humidity is to be cooled to 14°C and fed into a plant area at a rate of 510m3/min. (a) Calculate th
    11·1 answer
  • A bar of 75 mm diameter is reduced to 73mm by a cutting tool while cutting orthogonally. If the mean length of the cut chip is 7
    10·1 answer
  • A soil has the following Green-Ampt parameters Effective porosity 0.400 Initial volumetric moisture content-15% Hydraulic Conduc
    6·1 answer
  • The goal of the Concept Selection phase is to (please choose the best answer): Group of answer choices
    10·1 answer
  • The natural material in a borrow pit has a mass unit weight of 110.0 pcf and a water content of 6%, and the specific gravity of
    11·1 answer
  • View the picture below and then correctly answer the questions using the following words: Temperate Zone, Tropical Zone, Polar Z
    6·2 answers
  • TWO SENTENCES!!! What is something that you have used today that was designed by an engineer? What parts were designed by an eng
    11·2 answers
  • 2. The speaker argues that more data allow us to see new things. Think about your favorite hobby—skateboarding, listening to mus
    8·2 answers
  • Can someone tell me what car, year, and model this is please
    15·2 answers
  • How do you breed a linner?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!