Answer:
- import random
-
- states = {
- "Alabama": "Montgomery",
- "California": "Sacramento",
- "Florida": "Tallahassee",
- "Hawaii": "Honolulu",
- "Indiana": "Indianapolis",
- "Michigan": "Lansing",
- "New York": "Albany",
- "Texas" : "Austin",
- "Utah" : "Salt Lake City",
- "Wisconsin": "Madison"
- }
-
- correct = 0
- wrong = 0
- round = 1
- while(round <= 5):
- current_state = random.choice(list(states))
- answer = input("What is the capital of " + current_state + ": ")
-
- if(answer == states[current_state]):
- correct += 1
- else:
- wrong += 1
-
- round += 1
-
- print("Correct answer: " + str(correct))
- print("Wrong answer: " + str(wrong))
Explanation:
The solution code is written in Python 3.
Line 3 -14
Create a dictionary of US States with capital as each of their corresponding value. Please note only ten sample states are chosen here.
Line 16 - 18
Create variables to track the number of correct and inaccurate response and also round counter.
Line 19 - 28
Set the while condition to enable user to play the quiz for five questions and use random.choice to randomly pick a state from the dictionary and prompt user to input the capital of selected stated.
If the answer matched with the capital value of the selected state, increment the correct counter by one. Otherwise the wrong counter will be incremented by one. Increment the round counter by one before proceed to next round.
Line 30 - 31
Print the number of correct responses and wrong responses.
Answer:
The Command Staff are the incident management personnel that the incident commander or unified command assign to directly support the command function.
Explanation:
Based on the information retrieved from the ICS (Incident Command System), to handle properly incidents that occur, Command Staff are assigned by the incident commander or unified command.
Answer:
Most injury crashes in Florida happen in dusk conditions
Explanation:
Dusk is the time of the day when the sun is setting. At this time of the day, the visibility on the roads is less. This time of the day, the number of cars on the roads is also significantly greater. This indirectly means that the possibility of most injury crashes in Florida in dusk conditions considerably increases.
The amount of tourism happening in the state is also a condition that takes part in injury crashes due to increased traffic on the roads.
Answer:
see explaination
Explanation:
class Taxicab():
def __init__(self, x, y):
self.x_coordinate = x
self.y_coordinate = y
self.odometer = 0
def get_x_coord(self):
return self.x_coordinate
def get_y_coord(self):
return self.y_coordinate
def get_odometer(self):
return self.odometer
def move_x(self, distance):
self.x_coordinate += distance
# add the absolute distance to odometer
self.odometer += abs(distance)
def move_y(self, distance):
self.y_coordinate += distance
# add the absolute distance to odometer
self.odometer += abs(distance)
cab = Taxicab(5,-8)
cab.move_x(3)
cab.move_y(-4)
cab.move_x(-1)
print(cab.odometer) # will print 8 3+4+1 = 8