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

 

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

s1 and s2 are strings and n is a valid index of s1. The function returns a string similar to s1 except the character at index n has been deleted and replaced with s2.


replace('seven', 'COW', 1) → 'sCOWven'
replace('apple', 'window', 0) → 'windowpple'
replace('ROCK', '*', 2) → 'RO*K'

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

def replace( s1, s2, n ):

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: 150

Copyright Nick Parlante 2017 - privacy