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

Python > String-1 > first_half
prev  |  next  |  chance

Given a string of even length, return the first half. So the string "WooHoo" yields "Woo".

first_half('WooHoo') → 'Woo'
first_half('HelloThere') → 'Hello'
first_half('abcdef') → 'abc'

...Save, Compile, Run

See also Python Example Code. Python help docs: Python Strings | Python Lists | Python If Boolean


prev  |  next  |  chance   |  CodingBat  >  String-1

Forget It! -- delete my code for this problem 121.0

Copyright Nick Parlante 2006-10 - privacy