Information about cookies on this page

Our website uses cookies to ensure the functionality of the website, to collect and analyze information about the performance and usage of the website. Privacy Policy

  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in
  
  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in

Quiz: The Same Mistake

This program should print Longest: 60. It prints 60, and then Longest: None. It's the kind of mistake you've just had explained, in another program. Click the line with the mistake.

1def longest(walks):
2    best = 0
3    for minutes in walks:
4        if minutes > best:
5            best = minutes
6    print(best)
7
8week = [30, 45, 20, 60]
9print("Longest:", longest(week))
Back

3/7

  1. 1. Hints First
  2. 2. Explain It, Don't Fix It
  3. 3. Quiz: The Same Mistake
  4. 4. Feedback, Not a Rewrite
  5. 5. Let It Quiz You
  6. 6. Quiz: Who Writes It?
  7. 7. Summary
Next

Try it yourself

Do this exercise right here in your browser. No account needed.