A ferry display-screen HTML that needs the internet to draw
Code review · Basic · §9.5 Saving and sharing as HTML
This AI draft saves a bar chart of daily ferry passengers by route as ferry.html. The file will be opened on the ferry's information screen, which has no internet connection out at sea, and only this one file will be moved there. If you save it as the draft does, the chart does not draw on the screen.
Change one line so that the file draws the chart without the internet. Grading changes the passenger counts and saves the file again.
Code to fix
import pandas as pd
import plotly.express as px
ferries = pd.DataFrame({
"route": ["Jeju", "Ulleung", "Geoje", "Wando"],
"passengers": [210, 160, 240, 90],
})
fig = px.bar(ferries, x="route", y="passengers", title="Daily ferry passengers by route")
fig.write_html("ferry.html", include_plotlyjs="cdn")Solve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.