Practice Python

Beginner Python exercises

25 April 2014

List Ends

Exercise 12 (and Solution)

Write a program that takes a list of numbers (for example, a = [5, 10, 15, 20, 25]) and makes a new list of only the first and last elements of the given list. For practice, write this code inside a function.

Concepts to practice

Happy coding!

Forgot how to submit exercises?

Share the fun!


comments powered by Disqus