Re: [Tutor] Pycharm Edu Lesson 3, Task 7

2017-05-04 Thread David Wolfe
Thanks all for the help.

Pycharm just posted an update to their Pycharm Edu product, and when I
re-ran the script, everything was fine.

Best,
David

On Tue, May 2, 2017 at 4:27 AM, Alan Gauld via Tutor 
wrote:

> On 02/05/17 01:42, David Wolfe wrote:
>
> > 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.
>
> I'm assuming this is only part of the story since the instructions don't
> make sense. There is no need for type conversion here.
>
> > 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"
>
> I don't know the PyCharm IDE but is that all it says?
> I'd expect a bit more information about where the error lies.
> It certainly isn't obvious and I don't get any such error when
> I execute your code in IDLE.
>
> --
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> http://www.amazon.com/author/alan_gauld
> Follow my photo-blog on Flickr at:
> http://www.flickr.com/photos/alangauldphotos
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Pycharm Edu Lesson 3, Task 7

2017-05-02 Thread Alan Gauld via Tutor
On 02/05/17 01:42, David Wolfe wrote:

> 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.

I'm assuming this is only part of the story since the instructions don't
make sense. There is no need for type conversion here.

> 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"

I don't know the PyCharm IDE but is that all it says?
I'd expect a bit more information about where the error lies.
It certainly isn't obvious and I don't get any such error when
I execute your code in IDLE.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Pycharm Edu Lesson 3, Task 7

2017-05-02 Thread David Wolfe
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





Virus-free.
www.avg.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor