Talk:O'Reilly Introduction to Python

From OpenHatch wiki
Revision as of 18:07, 11 April 2017 by (talk) (Lesson 18 Output Error)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


I'm currently on Lesson 18: Headlines. We're given a list of headlines and supposed to output all headlines with a length less than 35 characters. I'm posting my code below and it prints the proper headlines, but when I click submit, I am being told, "Oops, try again. Your output didn't match what I was expecting. Double-check your `if` condition and try again." Please advise.

headlines = ["Man Takes First Steps on the Moon", "Titanic Sinks Four Hours After Hitting Iceberg", "Dewey Defeats Truman", "Greatest Crash in Wall Street's History"]

maximum_headline_length = 35 for hl in headlines:

   if len(hl) < maximum_headline_length: