Study Guide

7.2.6 If You’re not First, You’re Last CodeHS Answers

7.2.6 If You’re not First, You’re Last CodeHS Answers

The most common answer is:

word = "Surron"

def end_of_word(word):
    return word[1:]

print(end_of_word(word))

This code defines a function named end_of_word that takes a string (word) as input and returns a new string that excludes the first character of the input string. For the input “Surron”, it will output “urron”.