id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

bryce.hulett@hotmail.com > is_palindrome
prev  |  next  |  chance

Write a function is_palindrome that accepts a list of strings as its argument and returns True if that list is a palindrome (if it reads the same forwards as backwards) and False if not. For example, the list ["alpha", "beta", "gamma", "delta", "gamma", "beta", "alpha"] is a palindrome, so passing that list to your function would return True. Lists with zero or one element are considered to be palindromes.


is_palindrome(['alpha', 'beta', 'gamma', 'delta', 'gamma', 'beta', 'alpha']) → True
is_palindrome(['one', 'two', 'one']) → True
is_palindrome(['one', 'two']) → False

...Save, Compile, Run (ctrl-enter)

def is_palindrome(lst):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 290 Post-solution available

Copyright Nick Parlante 2017 - privacy