[Baypiggies] line error on no. 7

Martin Falatic martin at falatic.com
Tue Jul 28 22:55:36 CEST 2015


First of all, you can't use split() on a list.

Second, you have lots of typos... you're calling things like "append" on
the data type, not the variable you created (list.append versus
lst.append(something). Read the man pages... e.g.,
https://docs.python.org/2/tutorial/datastructures.html

 - Marty



On Tue, July 28, 2015 13:14, ltc.hotspot at gmail.com wrote:
> Hi Everyone,
>
>
>
> I'm writing python code to read a data text file, split the file into a
> list of words using the split(function) and to print the results in
> alphabetical order.
>
>
> The raw python code is located at http://tinyurl.com/oua9uqx
>
>
>
> The sample data is located at
> http://tinyurl.com/odt9nhe
>
>
>
>
> Desired Output: ['Arise', 'But', 'It', 'Juliet', 'Who', 'already', 'and',
> 'breaks', 'east', 'envious', 'fair', 'grief', 'is', 'kill', 'light',
> 'moon', 'pale', 'sick', 'soft', 'sun', 'the', 'through', 'what',
> 'window', 'with', 'yonder']
>
>
>
> There is a line error on no. 7
> What is the cause of this error?
>
>
>
>
> Regards,
> Hal
>
>
>
>
>
>
>
> Sent from Surface_______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> https://mail.python.org/mailman/listinfo/baypiggies




More information about the Baypiggies mailing list