Lesson 5: The Art of Not Crashing (Again)

Today we cover the most important part of coding: avoiding crashes.

Exercise 4: Code Review (or How Not to Blow Up)

Write a script that takes in a list of integers and prints out the sum of all the numbers in the list, but only if the list has more than 5 elements. If the list has 5 or fewer elements, print out the first 5 elements instead. This will be a challenge, but don't worry, it's not as hard as it looks!

View Solution

Next Lesson: Lesson 6: The Art of Not Losing Your Keys

Back to Lesson 5: The Art of Not Crashing