[Tutor] Pycharm Edu Lesson 3, Task 7
David Wolfe
dkwolfe at gmail.com
Mon May 1 20:42:01 EDT 2017
Good Evening;
I'm working through Pycharm Edu, and I'm stuck on the following:
phrase = """
It is a really long string
triple-quoted strings are used
to define multi-line strings
"""
first_half = phrase[:len(phrase)//2]
print(first_half)
The instructions are:
The len() function is used to count how many characters a string contains.
Get the first half of the string stored in the variable phrase.
Note: Remember about type conversion.
and my output is:
It is a really long string
triple-quoted st
which is what I'm supposed to get, but I keep getting the error message
"Too short string in the output"
Any suggestions?
Thanks,
David
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
More information about the Tutor
mailing list