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

 

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

x is a string with a length of 6 or less. Complete the method so that it returns a string that is identical to the parameter except that (if the length is 4, 5, or 6), there is a comma before the last three characters in the string.


commas('better') → 'bet,ter'
commas('38495') → '38,495'
commas('TREE') → 'T,REE'

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

def commas( 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: 100

Copyright Nick Parlante 2017 - privacy