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

 

dsawyer@methacton.org > almostLastWord
prev  |  next  |  chance

x is a string that contains a phrase or sentence. Complete the method so that it returns the next to last word. There will be at least two words in the phrase or sentence.


almostLastWord('Mitch Hedberg') → 'Mitch'
almostLastWord('I saw a human pyramid once. It was very unnecessary.') → 'very'
almostLastWord('Fettucini alfredo is macaroni and cheese for adults.') → 'for'

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

def almostLastWord( x ):

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: 250 Post-solution available

Copyright Nick Parlante 2017 - privacy