Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Let's turn to the borough column. Let's count the number of film permits issued by each of the five boroughs in the city of New

Let's turn to the borough column. Let's count the number of film permits issued by each of the five boroughs in the city of New York.
Professor Hammett gives you some code to do this but it's incomplete. Loop through the 'Borough' column and count the permits by borough. Use context clues about the borough to match the correct count variable with the line in the if statement and print statements that it should go.
m_count =0
si_count =0
bk_count =0
bx_count =0
q_count =0
for row in [A]:
if( row == "Manhattan"):
[B]+=1
elif( row == "Brooklyn"):
[C]+=1
elif (row == "Bronx"):
[D]+=1
elif (row == "Staten Island"):
[E]+=1
elif (row == "Queens"):
[F]+=1
else:
pass
print("Manhattan: "+ str([G]))
print("Brooklyn: "+ str([H]))
print("Bronx: "+ str([I]))
print("Staten Island: "+ str([J]))
print("Queens: "+ str([K]))
Response Feedback:
Look at the count varaibles declared before the for loop. Use context clues on which should be incremented and printed in each line.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Apache Cassandra Development

Authors: Vivek Mishra

1st Edition

1484201426, 9781484201428

More Books

Students also viewed these Databases questions