# Testing out playing with Cams code
print('Cam\'s Origional Solution \n_________________')
def first_half(a_string):
if len(a_string) % 2 == 0:
return a_string[:int(len(a_string)/2)]
else:
return a_string[:int((len(a_string)/2)+1)]
print(first_half('abcdef'))
print(first_half('abcdefg'))
print('_________________')
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.