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

 

mattbobambrose@gmail.com > xchar
prev  |  next  |  chance

you are given a string and x. print the first x characters of the string


xchar('hello world', 4) → 'hell'
xchar('freepoiwjfpoeirjwpoifjoerifjoe', 4) → 'free'
xchar('now you can stop', 11) → 'now you can'

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

def xchar(str, 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: 200

Copyright Nick Parlante 2017 - privacy