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

 

dsawyer@methacton.org python_strings > part
prev  |  next  |  chance

x is a string of length 1 or more. a and b are integers where 0 <= a <= b < len(x). Complete the function so that it returns a string of all the characters in x from index a up to, and including index b.


part('computer', 1, 4) → 'ompu'
part('cat', 0, 2) → 'cat'
part('dog', 2, 2) → 'g'

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

def part( x, a, b ):

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