Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #79469 > unrolled thread

I am out of trial and error again Lists

Started bySeymore4Head <Seymore4Head@Hotmail.invalid>
First post2014-10-22 16:30 -0400
Last post2014-10-25 22:15 +0000
Articles 20 on this page of 157 — 23 participants

Back to article view | Back to comp.lang.python


Contents

  I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-22 16:30 -0400
    Re: I am out of trial and error again Lists Joel Goldstick <joel.goldstick@gmail.com> - 2014-10-22 16:57 -0400
      Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-22 17:04 -0400
        Re: I am out of trial and error again Lists sohcahtoa82@gmail.com - 2014-10-22 14:35 -0700
          Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-22 17:38 -0400
    Re: I am out of trial and error again Lists Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-22 22:28 +0100
    Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-22 18:30 -0400
      Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-22 18:32 -0400
      Re: I am out of trial and error again  Lists Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-22 23:55 +0100
        Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-22 19:26 -0400
          Re: I am out of trial and error again  Lists Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-23 00:44 +0100
            Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-22 20:02 -0400
              Re: I am out of trial and error again  Lists MRAB <python@mrabarnett.plus.com> - 2014-10-23 02:29 +0100
              Re: I am out of trial and error again  Lists alex23 <wuwei23@gmail.com> - 2014-10-23 11:37 +1000
                Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-22 21:52 -0400
              Re: I am out of trial and error again  Lists Larry Hudson <orgnut@yahoo.com> - 2014-10-22 19:58 -0700
                Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-22 23:05 -0400
                Re: I am out of trial and error again  Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-22 20:16 -0700
                Re: I am out of trial and error again  Lists Terry Reedy <tjreedy@udel.edu> - 2014-10-23 02:31 -0400
      Re: I am out of trial and error again  Lists MRAB <python@mrabarnett.plus.com> - 2014-10-23 00:09 +0100
      Re: I am out of trial and error again  Lists Larry Hudson <orgnut@yahoo.com> - 2014-10-23 00:10 -0700
        Re: I am out of trial and error again  Lists Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-23 09:23 -0400
          Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-23 10:00 -0400
            Re: I am out of trial and error again  Lists Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-23 20:23 -0400
        Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-23 09:53 -0400
      Re: I am out of trial and error again  Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-23 09:15 +0000
        Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-23 10:04 -0400
          Re: I am out of trial and error again  Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-23 15:55 +0000
            Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-23 13:01 -0400
              Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-23 13:07 -0400
                Re: I am out of trial and error again Lists Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-23 13:39 -0600
                  Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-23 16:15 -0400
                  Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-23 16:44 -0400
                    Re: I am out of trial and error again Lists MRAB <python@mrabarnett.plus.com> - 2014-10-23 22:03 +0100
                    Re: I am out of trial and error again Lists Larry Hudson <orgnut@yahoo.com> - 2014-10-23 19:13 -0700
                Re: I am out of trial and error again Lists Terry Reedy <tjreedy@udel.edu> - 2014-10-23 23:14 -0400
                Re: I am out of trial and error again Lists Chris Angelico <rosuav@gmail.com> - 2014-10-24 14:32 +1100
              Re: I am out of trial and error again  Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-23 21:56 -0700
                Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 10:38 -0400
                  Re: I am out of trial and error again Lists Chris Angelico <rosuav@gmail.com> - 2014-10-25 01:51 +1100
                    Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 11:04 -0400
                      Re: I am out of trial and error again Lists Chris Angelico <rosuav@gmail.com> - 2014-10-25 02:13 +1100
                  Re: I am out of trial and error again  Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-24 08:56 -0700
                    Re: I am out of trial and error again Lists Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-24 10:35 -0600
                      Re: I am out of trial and error again Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-24 10:10 -0700
                    Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 12:37 -0400
                      Re: I am out of trial and error again Lists Chris Angelico <rosuav@gmail.com> - 2014-10-25 03:47 +1100
                        Re: I am out of trial and error again Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-24 09:56 -0700
                        Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 13:03 -0400
                          Re: I am out of trial and error again Lists "Albert Visser" <albert.visser@gmail.com> - 2014-10-24 19:18 +0200
                            Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 13:23 -0400
                              Re: I am out of trial and error again Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-24 10:42 -0700
                                Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 13:42 -0400
                          Re: I am out of trial and error again Lists Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-24 11:52 -0600
                            Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 14:15 -0400
                              Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 14:20 -0400
                                Re: I am out of trial and error again Lists Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-24 19:40 +0100
                                  Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 15:07 -0400
                                    Re: I am out of trial and error again Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-24 21:49 +0000
                                    Re: I am out of trial and error again Lists Larry Hudson <orgnut@yahoo.com> - 2014-10-24 23:46 -0700
                                      Re: I am out of trial and error again Lists Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-25 08:17 -0600
                                    Re: I am out of trial and error again Lists Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-25 14:47 -0400
                              Re: I am out of trial and error again Lists sohcahtoa82@gmail.com - 2014-10-24 11:57 -0700
                                Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 15:09 -0400
                                  Re: I am out of trial and error again Lists sohcahtoa82@gmail.com - 2014-10-24 12:25 -0700
                                    Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 15:33 -0400
                                      Re: I am out of trial and error again Lists sohcahtoa82@gmail.com - 2014-10-24 12:55 -0700
                                        Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 16:00 -0400
                              Re: I am out of trial and error again Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-24 21:19 +0000
                                Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 17:35 -0400
                                  Re: I am out of trial and error again Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-24 23:23 +0000
                              Re: I am out of trial and error again Lists Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-25 14:37 -0400
                          Re: I am out of trial and error again Lists Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-24 19:33 +0100
                      Re: I am out of trial and error again  Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-24 09:54 -0700
                        Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 13:04 -0400
                          Re: I am out of trial and error again  Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-24 10:17 -0700
                          Re: I am out of trial and error again  Lists Dave Angel <davea@davea.name> - 2014-10-24 18:09 -0400
                            Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 18:27 -0400
                              Re: I am out of trial and error again  Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-24 16:01 -0700
                              Re: I am out of trial and error again  Lists Terry Reedy <tjreedy@udel.edu> - 2014-10-24 20:27 -0400
                                Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 20:42 -0400
                      Re: I am out of trial and error again Lists Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-24 11:05 -0600
                      Re: I am out of trial and error again Lists Chris Angelico <rosuav@gmail.com> - 2014-10-25 04:10 +1100
                      Re: I am out of trial and error again  Lists Larry Hudson <orgnut@yahoo.com> - 2014-10-24 23:04 -0700
                  Re: I am out of trial and error again  Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-24 20:37 +0000
                    Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 16:58 -0400
                      Re: I am out of trial and error again  Lists alister <alister.nospam.ware@ntlworld.com> - 2014-10-24 21:07 +0000
                      Re: I am out of trial and error again Lists Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-24 15:11 -0600
                      Re: I am out of trial and error again  Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-24 23:21 +0000
                        Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 19:48 -0400
                  Re: I am out of trial and error again  Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-24 21:48 +0000
                    Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 18:14 -0400
                    Re: I am out of trial and error again  Lists Grant Edwards <invalid@invalid.invalid> - 2014-10-25 15:01 +0000
                      Re: I am out of trial and error again  Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-25 20:51 +0000
                  Re: I am out of trial and error again  Lists Larry Hudson <orgnut@yahoo.com> - 2014-10-24 19:16 -0700
                    Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 22:41 -0400
                      Re: I am out of trial and error again  Lists Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-25 08:25 +0100
                      Re: I am out of trial and error again  Lists Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-25 15:10 -0400
                  Re: I am out of trial and error again  Lists Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-25 14:23 -0400
                    Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-25 14:42 -0400
                  Re: I am out of trial and error again  Lists Terry Reedy <tjreedy@udel.edu> - 2014-10-25 18:48 -0400
                  Re: I am out of trial and error again  Lists Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-26 00:25 +0100
                  Re: I am out of trial and error again  Lists Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-26 01:08 -0400
                  Re: I am out of trial and error again  Lists Terry Reedy <tjreedy@udel.edu> - 2014-10-26 17:44 -0400
                  Re: I am out of trial and error again  Lists Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-26 20:57 -0400
    Re: I am out of trial and error again  Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-22 22:43 +0000
      Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-22 19:11 -0400
        The “trials” in “trial and error” should be as simple as possible (was: I am out of trial and error again  Lists) Ben Finney <ben+python@benfinney.id.au> - 2014-10-23 10:59 +1100
        Re: I am out of trial and error again  Lists Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-23 11:05 +1100
          Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-22 20:10 -0400
            Re: I am out of trial and error again  Lists MRAB <python@mrabarnett.plus.com> - 2014-10-23 02:31 +0100
              Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-22 21:35 -0400
                Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-22 21:57 -0400
                  Re: I am out of trial and error again  Lists Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-23 08:20 +0100
                    Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-23 10:01 -0400
                  Re: I am out of trial and error again Lists Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-23 01:56 -0600
                  Re: I am out of trial and error again Lists Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-23 09:09 +0100
                    Re: I am out of trial and error again Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-23 06:42 -0700
                      Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-23 10:03 -0400
                        Re: I am out of trial and error again Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-23 08:35 -0700
                      Re: I am out of trial and error again Lists giacomo boffi <pecore@pascolo.net> - 2014-10-23 16:25 +0200
                        Re: I am out of trial and error again Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-23 10:29 -0400
                        Re: I am out of trial and error again Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-23 16:00 +0000
                Re: I am out of trial and error again  Lists giacomo boffi <pecore@pascolo.net> - 2014-10-23 16:40 +0200
                  Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-23 10:46 -0400
                  Re: I am out of trial and error again  Lists giacomo boffi <pecore@pascolo.net> - 2014-10-24 17:56 +0200
        Re: I am out of trial and error again  Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-23 09:21 +0000
    Re: I am out of trial and error again  Lists Tobiah <toby@tobiah.org> - 2014-10-23 07:51 -0700
    Re: I am out of trial and error again  Lists Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-24 08:05 +0100
      Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 10:47 -0400
        Re: I am out of trial and error again  Lists mm0fmf <none@mailinator.com> - 2014-10-24 22:06 +0100
    Re: I am out of trial and error again  Lists Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-24 09:12 +0100
      Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 10:48 -0400
    Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 18:26 -0400
    Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 18:58 -0400
      Re: I am out of trial and error again  Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-24 16:27 -0700
        Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 19:48 -0400
          Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 19:57 -0400
            Re: I am out of trial and error again  Lists MRAB <python@mrabarnett.plus.com> - 2014-10-25 01:20 +0100
              Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 20:37 -0400
                Re: I am out of trial and error again  Lists Cameron Simpson <cs@zip.com.au> - 2014-10-25 11:52 +1100
          Re: I am out of trial and error again  Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-24 20:46 -0700
            Re: I am out of trial and error again  Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-24 21:09 -0700
              Re: I am out of trial and error again  Lists Ben Finney <ben+python@benfinney.id.au> - 2014-10-25 15:25 +1100
                Re: I am out of trial and error again  Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-24 22:40 -0700
                  Re: I am out of trial and error again Lists Chris Angelico <rosuav@gmail.com> - 2014-10-25 16:49 +1100
                    Re: I am out of trial and error again Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-24 22:55 -0700
                      Re: I am out of trial and error again Lists Chris Angelico <rosuav@gmail.com> - 2014-10-25 17:03 +1100
                      Re: I am out of trial and error again Lists Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-25 18:44 +1100
                        Re: I am out of trial and error again Lists Rustom Mody <rustompmody@gmail.com> - 2014-10-25 10:24 -0700
                    Side-effects [was Re: I am out of trial and error again Lists] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-26 17:12 +1100
                      Re: Side-effects [was Re: I am out of trial and error again Lists] Chris Angelico <rosuav@gmail.com> - 2014-10-26 17:42 +1100
            Re: I am out of trial and error again  Lists giacomo boffi <pecore@pascolo.net> - 2014-10-27 22:26 +0100
      Re: I am out of trial and error again  Lists Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-25 00:27 +0100
      Re: I am out of trial and error again  Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-24 23:35 +0000
    Re: I am out of trial and error again  Lists Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-24 20:15 -0400
      Re: I am out of trial and error again  Lists Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-25 22:15 +0000

Page 3 of 8 — ← Prev page 1 2 [3] 4 5 6 7 8  Next page →


#79573 — Re: I am out of trial and error again Lists

FromSeymore4Head <Seymore4Head@Hotmail.invalid>
Date2014-10-24 11:04 -0400
SubjectRe: I am out of trial and error again Lists
Message-ID<v5qk4a5e4emmu3ph88llitbq32vb0m1hv1@4ax.com>
In reply to#79572
On Sat, 25 Oct 2014 01:51:41 +1100, Chris Angelico <rosuav@gmail.com>
wrote:

>On Sat, Oct 25, 2014 at 1:38 AM, Seymore4Head
><Seymore4Head@hotmail.invalid> wrote:
>> I tried list(range(10)  I thought that would work in Python 3.  It
>> didn't.
>
>This is your problem: You say "it didn't work". That is almost *never*
>the right thing to say or to think. What happened when you tried that?
>Did you get a SyntaxError because of the omitted close parenthesis?
>Did the interpreter prompt for more input? Did a velociraptor come out
>of nowhere and try to kill you [1]?
>
I understand that it makes it easier for you if I can describe better
the error I get, but by the time I ask for help here I have tried many
different things to get the error to go away.

I will try in the future to do better at this.  For now, I am just
putting that exercise behind me.  I do try to find out how to do
things before asking first.

I tried so many things last night, I had to go back to an old message
to get code that worked again.

Thanks

>When you come back to python-list, you should say exactly what you did
>and exactly what happened, not "I tried X and it didn't work". Copy
>and paste from your interactive session - do NOT retype, because you
>introduce new errors. It's very hard to help you when you don't
>explain what you're doing, and just keep on telling us how frustrated
>you are.
>
>ChrisA
>
>[1] http://xkcd.com/292/

[toc] | [prev] | [next] | [standalone]


#79574 — Re: I am out of trial and error again Lists

FromChris Angelico <rosuav@gmail.com>
Date2014-10-25 02:13 +1100
SubjectRe: I am out of trial and error again Lists
Message-ID<mailman.15130.1414163650.18130.python-list@python.org>
In reply to#79573
On Sat, Oct 25, 2014 at 2:04 AM, Seymore4Head
<Seymore4Head@hotmail.invalid> wrote:
> I understand that it makes it easier for you if I can describe better
> the error I get, but by the time I ask for help here I have tried many
> different things to get the error to go away.

That's part of the problem. You let yourself get frustrated and
confused, and you still have no idea what you're doing. Ask sooner, if
you have to; or develop the discipline to keep track of what you do
and what happens. But regardless of what actually happens, "it didn't
work" is not a helpful thing to say.

Trust me, making it easier for us will make everything easier for you
too. Even if we were to never answer a single question of yours ever
again, learning to read error messages will benefit you more than you
can imagine.

ChrisA

[toc] | [prev] | [next] | [standalone]


#79575

FromRustom Mody <rustompmody@gmail.com>
Date2014-10-24 08:56 -0700
Message-ID<3082ee74-3182-4ea5-9851-2b1326e5b34c@googlegroups.com>
In reply to#79569
On Friday, October 24, 2014 8:11:12 PM UTC+5:30, Seymore4Head wrote:
> On Thu, 23 Oct 2014 21:56:31 -0700 (PDT), Rustom Mody wrote:
> 
> >On Thursday, October 23, 2014 10:33:57 PM UTC+5:30, Seymore4Head wrote:
> >> On Thu, 23 Oct 2014 15:55:35 +0000 (UTC), Denis McMahon wrote:
> >> 
> >> >On Thu, 23 Oct 2014 10:04:56 -0400, Seymore4Head wrote:
> >> >
> >> >> On Thu, 23 Oct 2014 09:15:16 +0000 (UTC), Denis McMahon wrote:
> >> >
> >> >>>Try the following 3 commands at the console:
> >> >
> >> >You obviously didn't, so I'll try again. Try each of the following three 
> >> >commands in the python console at the ">>>" prompt.
> >> >
> >> >1) 10
> >> 10
> >> 
> >> >2) range(10)
> >> range(0, 10)
> >> 
> >> >3) str(range(10))
> >> 'range(0, 10)'
> >> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
> >> >
> >> >Show *and* describe the output in each case. Describing the output that 
> >> >you see is actually the key here, as it will allow us to assess whether 
> >> >you understand what you are actually seeing or not, and if you don't 
> >> >understand the output you see in the console, then we need to fix that 
> >> >very fundamental and basic issue before moving on to more complex stuff!
> >> >
> >> >> Ok Thanks
> >> >
> >> >You were expected to answer the question in the original. I have now set 
> >> >it as a clearer and more specific task.
> >> >
> >> >If you're not going to do these things that are intended to help you 
> >> >learn some of the basic features of the language, then I and everyone 
> >> >else here that has so far been attempting to help you are wasting our 
> >> >time.
> >> 
> >> I did try them.  I may have missed replying your to your specific
> >> comment, but I tried them.
> >> 
> >> BTW str(range (10)) does work with Python 2 which is where I may have
> >> got the idea.  I happened to be using Python 3 at the time I tried to
> >> implement it.  It is a little confusing jumping back and forth, but
> >> for the moment, I am going to tough it out.
> >> 
> >> I do appreciate all the help too.
> >
> >Hi Seymore!
> >
> >Happy to see that you are moving on from
> >"reading much; understanding nothing; thrashing"
> >
> >to
> >
> >"reading a bit; understanding a bit"
> >[And thanks to Denis to getting you out of your confusion-hole]
> >
> >So heres a small additional question set that I promise will more than repay
> >you your time.
> >
> >Better done in python 2. But if you use python3, below replace
> >range(10)
> >with
> >list(range(10))

<Other details skipped>

> 
> I tried list(range(10)  I thought that would work in Python 3.  It
> didn't.  I spent quite a bit of time last night trying to come up with
> the right combination of str and int commands to make range(10) work
> with my simple example.   It didn't.  I am pretty frustrated.  I am
> just skipping that little bit of code for the moment.

I asked you to try
list(range(10))

Did you try EXACTLY (cut-paste) that?

You are claiming to have tried
list(range(10)

Thats one closing parenthesis less

The interaction with your version would go something like this:
[Two versions 
The KeyboardInterrupt comes from giving a control-C
Dunno what happens in codeskulptor
]

>>> list(range(10)
... 
... 
... 
... )
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> list(range(10)
... 
KeyboardInterrupt


> 
> Thanks everyone for your suggestions.

1. You are reading too much
2. Trying tooooo hard

Think of riding a bicycle.
Cant do it by reading many books on cycling -- thats 1.
Nor by holding the handle so hard you tremble -- thats 2.

Just relax a bit...
And take small steps

Chill... as Chris joked, no monster in the computer (or on this list!)


> Range(10) stores the min max values and loads each number in between
> when needed.

It loads?? As in 'load-up-a-van'??

When you see:

>>> 10
10

1. Does someone (a clerk maybe) in the computer count to 10?
2. Or do you, seeing that interaction, count to 10?
   [If you do, replace the 10 by 1000]
3. Or do you, remember what it means to count to 10 without having to do it?

Now go back to your statement about 'loading' and find a better verb

[toc] | [prev] | [next] | [standalone]


#79577 — Re: I am out of trial and error again Lists

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-10-24 10:35 -0600
SubjectRe: I am out of trial and error again Lists
Message-ID<mailman.15133.1414168593.18130.python-list@python.org>
In reply to#79575
On Fri, Oct 24, 2014 at 9:56 AM, Rustom Mody <rustompmody@gmail.com> wrote:
>> Range(10) stores the min max values and loads each number in between
>> when needed.
>
> It loads?? As in 'load-up-a-van'??

As in loads into memory.

> When you see:
>
>>>> 10
> 10
>
> 1. Does someone (a clerk maybe) in the computer count to 10?
> 2. Or do you, seeing that interaction, count to 10?
>    [If you do, replace the 10 by 1000]
> 3. Or do you, remember what it means to count to 10 without having to do it?

I don't understand why you think any of these are implied by the word "load".

> Now go back to your statement about 'loading' and find a better verb

I presume he used "load" because that was the word I used in my
explanatory post about the difference between range in Python 2 and
Python 3 yesterday.

[toc] | [prev] | [next] | [standalone]


#79586 — Re: I am out of trial and error again Lists

FromRustom Mody <rustompmody@gmail.com>
Date2014-10-24 10:10 -0700
SubjectRe: I am out of trial and error again Lists
Message-ID<2c07fa2b-6c85-4572-abff-eab5c2454be6@googlegroups.com>
In reply to#79577
On Friday, October 24, 2014 10:06:47 PM UTC+5:30, Ian wrote:
> On Fri, Oct 24, 2014 at 9:56 AM, Rustom Mody wrote:
> >> Range(10) stores the min max values and loads each number in between
> >> when needed.
> >
> > It loads?? As in 'load-up-a-van'??
> 
> As in loads into memory.
> 
> > When you see:
> >
> >>>> 10
> > 10
> >
> > 1. Does someone (a clerk maybe) in the computer count to 10?
> > 2. Or do you, seeing that interaction, count to 10?
> >    [If you do, replace the 10 by 1000]
> > 3. Or do you, remember what it means to count to 10 without having to do it?
> 
> I don't understand why you think any of these are implied by the word "load".
> 
> > Now go back to your statement about 'loading' and find a better verb
> 
> I presume he used "load" because that was the word I used in my
> explanatory post about the difference between range in Python 2 and
> Python 3 yesterday.

I would be very surprised (Ian) if we had any essential disagreement on this
subject. [JFTR I see nothing wrong with your explanation]

I would also be (pleasantly) surprised if Seymore were to benefit by these
discussions at this stage.

So is it ok if we drop it here (or start a new thread)?

[toc] | [prev] | [next] | [standalone]


#79578

FromSeymore4Head <Seymore4Head@Hotmail.invalid>
Date2014-10-24 12:37 -0400
Message-ID<o2vk4ahadg1tjrfn2kh4vv2ji379vcka50@4ax.com>
In reply to#79575
On Fri, 24 Oct 2014 08:56:31 -0700 (PDT), Rustom Mody
<rustompmody@gmail.com> wrote:

>On Friday, October 24, 2014 8:11:12 PM UTC+5:30, Seymore4Head wrote:
>> On Thu, 23 Oct 2014 21:56:31 -0700 (PDT), Rustom Mody wrote:
>> 
>> >On Thursday, October 23, 2014 10:33:57 PM UTC+5:30, Seymore4Head wrote:
>> >> On Thu, 23 Oct 2014 15:55:35 +0000 (UTC), Denis McMahon wrote:
>> >> 
>> >> >On Thu, 23 Oct 2014 10:04:56 -0400, Seymore4Head wrote:
>> >> >
>> >> >> On Thu, 23 Oct 2014 09:15:16 +0000 (UTC), Denis McMahon wrote:
>> >> >
>> >> >>>Try the following 3 commands at the console:
>> >> >
>> >> >You obviously didn't, so I'll try again. Try each of the following three 
>> >> >commands in the python console at the ">>>" prompt.
>> >> >
>> >> >1) 10
>> >> 10
>> >> 
>> >> >2) range(10)
>> >> range(0, 10)
>> >> 
>> >> >3) str(range(10))
>> >> 'range(0, 10)'
>> >> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>> >> >
>> >> >Show *and* describe the output in each case. Describing the output that 
>> >> >you see is actually the key here, as it will allow us to assess whether 
>> >> >you understand what you are actually seeing or not, and if you don't 
>> >> >understand the output you see in the console, then we need to fix that 
>> >> >very fundamental and basic issue before moving on to more complex stuff!
>> >> >
>> >> >> Ok Thanks
>> >> >
>> >> >You were expected to answer the question in the original. I have now set 
>> >> >it as a clearer and more specific task.
>> >> >
>> >> >If you're not going to do these things that are intended to help you 
>> >> >learn some of the basic features of the language, then I and everyone 
>> >> >else here that has so far been attempting to help you are wasting our 
>> >> >time.
>> >> 
>> >> I did try them.  I may have missed replying your to your specific
>> >> comment, but I tried them.
>> >> 
>> >> BTW str(range (10)) does work with Python 2 which is where I may have
>> >> got the idea.  I happened to be using Python 3 at the time I tried to
>> >> implement it.  It is a little confusing jumping back and forth, but
>> >> for the moment, I am going to tough it out.
>> >> 
>> >> I do appreciate all the help too.
>> >
>> >Hi Seymore!
>> >
>> >Happy to see that you are moving on from
>> >"reading much; understanding nothing; thrashing"
>> >
>> >to
>> >
>> >"reading a bit; understanding a bit"
>> >[And thanks to Denis to getting you out of your confusion-hole]
>> >
>> >So heres a small additional question set that I promise will more than repay
>> >you your time.
>> >
>> >Better done in python 2. But if you use python3, below replace
>> >range(10)
>> >with
>> >list(range(10))
>
><Other details skipped>
>
>> 
>> I tried list(range(10)  I thought that would work in Python 3.  It
>> didn't.  I spent quite a bit of time last night trying to come up with
>> the right combination of str and int commands to make range(10) work
>> with my simple example.   It didn't.  I am pretty frustrated.  I am
>> just skipping that little bit of code for the moment.
>
>I asked you to try
>list(range(10))
>
>Did you try EXACTLY (cut-paste) that?
>
>You are claiming to have tried
>list(range(10)
>
>Thats one closing parenthesis less
>
>The interaction with your version would go something like this:
>[Two versions 
>The KeyboardInterrupt comes from giving a control-C
>Dunno what happens in codeskulptor
>]
>
>>>> list(range(10)
>... 
>... 
>... 
>... )
>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>>> list(range(10)
>... 
>KeyboardInterrupt
>
>
>> 
>> Thanks everyone for your suggestions.
>
>1. You are reading too much
>2. Trying tooooo hard
>
>Think of riding a bicycle.
>Cant do it by reading many books on cycling -- thats 1.
>Nor by holding the handle so hard you tremble -- thats 2.
>
>Just relax a bit...
>And take small steps
>
>Chill... as Chris joked, no monster in the computer (or on this list!)
>
>
>> Range(10) stores the min max values and loads each number in between
>> when needed.
>
>It loads?? As in 'load-up-a-van'??
>
>When you see:
>
>>>> 10
>10
>
>1. Does someone (a clerk maybe) in the computer count to 10?
>2. Or do you, seeing that interaction, count to 10?
>   [If you do, replace the 10 by 1000]
>3. Or do you, remember what it means to count to 10 without having to do it?
>
>Now go back to your statement about 'loading' and find a better verb

If I could explain to you why something doesn't work then I could fix
it myself.  I don't understand why it doesn't work.  The best I can do
is repost the code. 

When I use list(range(10)) I get:
Traceback (most recent call last):
  File "C:/Functions/name to number digit.py", line 37, in <module>
    print (nametonumber(a))#1800 438 2427 837
  File "C:/Functions/name to number digit.py", line 10, in
nametonumber
    if y in lst(range(1,10)):
TypeError: 'list' object is not callable

All the lines I have commented out work.  Trying to use
list(range(10)) doesn't.  (Python 3)
http://i.imgur.com/LtiCyZS.jpg

It doesn't work.
It's broke.  :)
I don't know what else to say.

import string
def nametonumber(name):
    lst=[]
    nx=[]
    digit=[]
    digit="".join(str(i) for i in range(10))
    for x in name:
        lst.append(x)
    for y in (lst):
        if y in lst(range(1,10)):
        #if y in "1234567890":
        #if y.isdigit():
        #if y in digit:       
        #if y in string.digits:
            nx.append(y)
        if y in " -()":
            nx.append(y)
        if y in "abc":
            nx.append("2")
        if y in "def":
            nx.append("3")
        if y in "ghi":
            nx.append("4")
        if y in "jkl":
            nx.append("5")
        if y in "mno":
            nx.append("6")
        if y in "pqrs":
            nx.append("7")
        if y in "tuv":
            nx.append("8")
        if y in "wxyz":
            nx.append("9")
    number="".join(e for e in nx)
    return number
a="1-800-getcharter"
print (nametonumber(a))#1800 438 2427 837
a="1-800-leo laporte"
print (nametonumber(a))
a="1 800 dialaho"
print (nametonumber(a))

BTW thanks again for all the help

[toc] | [prev] | [next] | [standalone]


#79580 — Re: I am out of trial and error again Lists

FromChris Angelico <rosuav@gmail.com>
Date2014-10-25 03:47 +1100
SubjectRe: I am out of trial and error again Lists
Message-ID<mailman.15135.1414169280.18130.python-list@python.org>
In reply to#79578
On Sat, Oct 25, 2014 at 3:37 AM, Seymore4Head
<Seymore4Head@hotmail.invalid> wrote:
> When I use list(range(10)) I get:
> Traceback (most recent call last):
>   File "C:/Functions/name to number digit.py", line 37, in <module>
>     print (nametonumber(a))#1800 438 2427 837
>   File "C:/Functions/name to number digit.py", line 10, in
> nametonumber
>     if y in lst(range(1,10)):
> TypeError: 'list' object is not callable

Now, finally, you're showing us an actual line of code and an actual
traceback. And from here, we can see that you misspelled "list".
That's why it isn't working.

Several people have told you to use the interactive interpreter. Please do so.

ChrisA

[toc] | [prev] | [next] | [standalone]


#79582 — Re: I am out of trial and error again Lists

FromRustom Mody <rustompmody@gmail.com>
Date2014-10-24 09:56 -0700
SubjectRe: I am out of trial and error again Lists
Message-ID<8e78cf4b-d7a8-4010-bf8d-fee8712dd912@googlegroups.com>
In reply to#79580
On Friday, October 24, 2014 10:18:12 PM UTC+5:30, Chris Angelico wrote:
> On Sat, Oct 25, 2014 at 3:37 AM, Seymore4Head wrote:
> > When I use list(range(10)) I get:
> > Traceback (most recent call last):
> >   File "C:/Functions/name to number digit.py", line 37, in <module>
> >     print (nametonumber(a))#1800 438 2427 837
> >   File "C:/Functions/name to number digit.py", line 10, in
> > nametonumber
> >     if y in lst(range(1,10)):
> > TypeError: 'list' object is not callable
> 
> Now, finally, you're showing us an actual line of code and an actual
> traceback. And from here, we can see that you misspelled "list".
> That's why it isn't working.
> 
> Several people have told you to use the interactive interpreter. Please do so.
> 
> ChrisA

Right.
Good.
Sorry for being impatient Seymore

You are now making progress

[toc] | [prev] | [next] | [standalone]


#79583 — Re: I am out of trial and error again Lists

FromSeymore4Head <Seymore4Head@Hotmail.invalid>
Date2014-10-24 13:03 -0400
SubjectRe: I am out of trial and error again Lists
Message-ID<9a1l4athfj10h7r3v69ddo95285n9cjlms@4ax.com>
In reply to#79580
On Sat, 25 Oct 2014 03:47:51 +1100, Chris Angelico <rosuav@gmail.com>
wrote:

>On Sat, Oct 25, 2014 at 3:37 AM, Seymore4Head
><Seymore4Head@hotmail.invalid> wrote:
>> When I use list(range(10)) I get:
>> Traceback (most recent call last):
>>   File "C:/Functions/name to number digit.py", line 37, in <module>
>>     print (nametonumber(a))#1800 438 2427 837
>>   File "C:/Functions/name to number digit.py", line 10, in
>> nametonumber
>>     if y in lst(range(1,10)):
>> TypeError: 'list' object is not callable
>
>Now, finally, you're showing us an actual line of code and an actual
>traceback. And from here, we can see that you misspelled "list".
>That's why it isn't working.
>
>Several people have told you to use the interactive interpreter. Please do so.
>
>ChrisA

Actually I was a little frustrated when I added that line back in as
the other lines all work.
Using list(range(10)) Doesn't throw an error but it doesn't work.

http://i.imgur.com/DTc5zoL.jpg

The interpreter.   I don't know how to use that either.

[toc] | [prev] | [next] | [standalone]


#79589 — Re: I am out of trial and error again Lists

From"Albert Visser" <albert.visser@gmail.com>
Date2014-10-24 19:18 +0200
SubjectRe: I am out of trial and error again Lists
Message-ID<mailman.15138.1414171108.18130.python-list@python.org>
In reply to#79583
On Fri, 24 Oct 2014 19:03:47 +0200, Seymore4Head  
<Seymore4Head@hotmail.invalid> wrote:

>
> http://i.imgur.com/DTc5zoL.jpg
>
> The interpreter.   I don't know how to use that either.
>

It's what's on the left hand side of your screenshot. You can simply type  
Python statements following the >>> prompt and hit enter to examine the  
result, instead of pushing F5 to run your code

-- 
Vriendelijke groeten / Kind regards,

Albert Visser

Using Opera's mail client: http://www.opera.com/mail/

[toc] | [prev] | [next] | [standalone]


#79592 — Re: I am out of trial and error again Lists

FromSeymore4Head <Seymore4Head@Hotmail.invalid>
Date2014-10-24 13:23 -0400
SubjectRe: I am out of trial and error again Lists
Message-ID<ll2l4a5hv5jdvm2p15klc0s5ah8lgad8fo@4ax.com>
In reply to#79589
On Fri, 24 Oct 2014 19:18:12 +0200, "Albert Visser"
<albert.visser@gmail.com> wrote:

>On Fri, 24 Oct 2014 19:03:47 +0200, Seymore4Head  
><Seymore4Head@hotmail.invalid> wrote:
>
>>
>> http://i.imgur.com/DTc5zoL.jpg
>>
>> The interpreter.   I don't know how to use that either.
>>
>
>It's what's on the left hand side of your screenshot. You can simply type  
>Python statements following the >>> prompt and hit enter to examine the  
>result, instead of pushing F5 to run your code

I guess I am confusing the Interpreter with the debugger.  Someone
suggested I use the Interpreter to step through line by line.
I don't know how to do that.

[toc] | [prev] | [next] | [standalone]


#79594 — Re: I am out of trial and error again Lists

FromRustom Mody <rustompmody@gmail.com>
Date2014-10-24 10:42 -0700
SubjectRe: I am out of trial and error again Lists
Message-ID<f1f0bf40-75f2-4162-a4b4-9c76baf4f8a7@googlegroups.com>
In reply to#79592
On Friday, October 24, 2014 10:55:44 PM UTC+5:30, Seymore4Head wrote:
> On Fri, 24 Oct 2014 19:18:12 +0200, "Albert Visser" wrote:
> 
> >On Fri, 24 Oct 2014 19:03:47 +0200, Seymore4Head  wrote:
> >
> >>
> >> http://i.imgur.com/DTc5zoL.jpg
> >>
> >> The interpreter.   I don't know how to use that either.
> >>
> >
> >It's what's on the left hand side of your screenshot. You can simply type  
> >Python statements following the >>> prompt and hit enter to examine the  
> >result, instead of pushing F5 to run your code
> 
> I guess I am confusing the Interpreter with the debugger.  Someone
> suggested I use the Interpreter to step through line by line.
> I don't know how to do that.

Dont bother with the debugger just yet.
For most python programmers, sticking a few print statements 
(expressions in python 3) in adroitly is good enough.*

For now best if you concentrate on
1. What are the features of python -- the language
2. What are the standard data types and functions -- the libraries
3. How to use and jump between the two windows of your screenshot most
   effectively. What you should and should not type in each etc

* One neat trick of using the print to debug.
Say you have a line like

nx.append("2")

and nx is not getting to be what you expect.
Change it to

nx.append("2"); print(nx)

Cleaning up the print after debugging is easier than if you use a
separate line like so

nx.append("2")
print(nx)

[I think I learnt this trick from Mark Lawrence]

[toc] | [prev] | [next] | [standalone]


#79595 — Re: I am out of trial and error again Lists

FromSeymore4Head <Seymore4Head@Hotmail.invalid>
Date2014-10-24 13:42 -0400
SubjectRe: I am out of trial and error again Lists
Message-ID<es3l4at5tvsp05ka5cbjkc8h72e8e2slnl@4ax.com>
In reply to#79594
On Fri, 24 Oct 2014 10:42:08 -0700 (PDT), Rustom Mody
<rustompmody@gmail.com> wrote:

>On Friday, October 24, 2014 10:55:44 PM UTC+5:30, Seymore4Head wrote:
>> On Fri, 24 Oct 2014 19:18:12 +0200, "Albert Visser" wrote:
>> 
>> >On Fri, 24 Oct 2014 19:03:47 +0200, Seymore4Head  wrote:
>> >
>> >>
>> >> http://i.imgur.com/DTc5zoL.jpg
>> >>
>> >> The interpreter.   I don't know how to use that either.
>> >>
>> >
>> >It's what's on the left hand side of your screenshot. You can simply type  
>> >Python statements following the >>> prompt and hit enter to examine the  
>> >result, instead of pushing F5 to run your code
>> 
>> I guess I am confusing the Interpreter with the debugger.  Someone
>> suggested I use the Interpreter to step through line by line.
>> I don't know how to do that.
>
>Dont bother with the debugger just yet.
>For most python programmers, sticking a few print statements 
>(expressions in python 3) in adroitly is good enough.*
>
>For now best if you concentrate on
>1. What are the features of python -- the language
>2. What are the standard data types and functions -- the libraries
>3. How to use and jump between the two windows of your screenshot most
>   effectively. What you should and should not type in each etc
>
>* One neat trick of using the print to debug.
>Say you have a line like
>
>nx.append("2")
>
>and nx is not getting to be what you expect.
>Change it to
>
>nx.append("2"); print(nx)
>
>Cleaning up the print after debugging is easier than if you use a
>separate line like so
>
>nx.append("2")
>print(nx)
>
>[I think I learnt this trick from Mark Lawrence]

Useful tips
Thanks

[toc] | [prev] | [next] | [standalone]


#79596 — Re: I am out of trial and error again Lists

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-10-24 11:52 -0600
SubjectRe: I am out of trial and error again Lists
Message-ID<mailman.15141.1414173184.18130.python-list@python.org>
In reply to#79583
On Fri, Oct 24, 2014 at 11:03 AM, Seymore4Head
<Seymore4Head@hotmail.invalid> wrote:
> Actually I was a little frustrated when I added that line back in as
> the other lines all work.
> Using list(range(10)) Doesn't throw an error but it doesn't work.
>
> http://i.imgur.com/DTc5zoL.jpg
>
> The interpreter.   I don't know how to use that either.

Try both of these in the interpreter, and observe the difference:

7 in range(10)

"7" in range(10)

Do you understand what the difference between 7 and "7" is?

[toc] | [prev] | [next] | [standalone]


#79598 — Re: I am out of trial and error again Lists

FromSeymore4Head <Seymore4Head@Hotmail.invalid>
Date2014-10-24 14:15 -0400
SubjectRe: I am out of trial and error again Lists
Message-ID<m35l4apklkp1nquk3r55hcogo5meccq348@4ax.com>
In reply to#79596
On Fri, 24 Oct 2014 11:52:15 -0600, Ian Kelly <ian.g.kelly@gmail.com>
wrote:

>On Fri, Oct 24, 2014 at 11:03 AM, Seymore4Head
><Seymore4Head@hotmail.invalid> wrote:
>> Actually I was a little frustrated when I added that line back in as
>> the other lines all work.
>> Using list(range(10)) Doesn't throw an error but it doesn't work.
>>
>> http://i.imgur.com/DTc5zoL.jpg
>>
>> The interpreter.   I don't know how to use that either.
>
>Try both of these in the interpreter, and observe the difference:
>
>7 in range(10)
>
>"7" in range(10)
>
>Do you understand what the difference between 7 and "7" is?

I do understand that.  7 is a number and "7" is a string.
What my question was...and still is...is why
Python 3 fails when I try using
y=1 800 get charter

y in range str(range(10))
should work because y is a string and str(range(10)) should be
"y" in str(1) fails.
It doesn't give an error it's just not True when y is a number.

These hints are just not working.  I am too thick for hints. :)
If you could use it in the code, I might understand.
The other work arounds that were posted work.
I have used them.  str(range(10)) doesn't work.

import string
def nametonumber(name):
    lst=[]
    nx=[]
    digit=[]
    digit="".join(str(i) for i in range(10))
    for x in name:
        lst.append(x)
    for y in (lst):
        if y in list(range(1,10)):
        #if y in "1234567890":
        #if y.isdigit():
        #if y in digit:       
        #if y in string.digits:
            nx.append(y)
        if y in " -()":
            nx.append(y)
        if y in "abc":
            nx.append("2")
        if y in "def":
            nx.append("3")
        if y in "ghi":
            nx.append("4")
        if y in "jkl":
            nx.append("5")
        if y in "mno":
            nx.append("6")
        if y in "pqrs":
            nx.append("7")
        if y in "tuv":
            nx.append("8")
        if y in "wxyz":
            nx.append("9")
    number="".join(e for e in nx)
    return number
a="1-800-getcharter"
print (nametonumber(a))#1800 438 2427 837
a="1-800-leo laporte"
print (nametonumber(a))
a="1 800 dialaho"
print (nametonumber(a))

Please

[toc] | [prev] | [next] | [standalone]


#79599 — Re: I am out of trial and error again Lists

FromSeymore4Head <Seymore4Head@Hotmail.invalid>
Date2014-10-24 14:20 -0400
SubjectRe: I am out of trial and error again Lists
Message-ID<j26l4al00cgt1o14ovpnr9nkilu2dve95s@4ax.com>
In reply to#79598
I meant to type:
if y in range(1,10) doesn't work.
Sigh
Sorry

On Fri, 24 Oct 2014 14:15:13 -0400, Seymore4Head
<Seymore4Head@Hotmail.invalid> wrote:

>On Fri, 24 Oct 2014 11:52:15 -0600, Ian Kelly <ian.g.kelly@gmail.com>
>wrote:
>
>>On Fri, Oct 24, 2014 at 11:03 AM, Seymore4Head
>><Seymore4Head@hotmail.invalid> wrote:
>>> Actually I was a little frustrated when I added that line back in as
>>> the other lines all work.
>>> Using list(range(10)) Doesn't throw an error but it doesn't work.
>>>
>>> http://i.imgur.com/DTc5zoL.jpg
>>>
>>> The interpreter.   I don't know how to use that either.
>>
>>Try both of these in the interpreter, and observe the difference:
>>
>>7 in range(10)
>>
>>"7" in range(10)
>>
>>Do you understand what the difference between 7 and "7" is?
>
>I do understand that.  7 is a number and "7" is a string.
>What my question was...and still is...is why
>Python 3 fails when I try using
>y=1 800 get charter
>
>y in range str(range(10))
>should work because y is a string and str(range(10)) should be
>"y" in str(1) fails.
>It doesn't give an error it's just not True when y is a number.
>
>These hints are just not working.  I am too thick for hints. :)
>If you could use it in the code, I might understand.
>The other work arounds that were posted work.
>I have used them.  str(range(10)) doesn't work.
>
>import string
>def nametonumber(name):
>    lst=[]
>    nx=[]
>    digit=[]
>    digit="".join(str(i) for i in range(10))
>    for x in name:
>        lst.append(x)
>    for y in (lst):
>        if y in list(range(1,10)):
>        #if y in "1234567890":
>        #if y.isdigit():
>        #if y in digit:       
>        #if y in string.digits:
>            nx.append(y)
>        if y in " -()":
>            nx.append(y)
>        if y in "abc":
>            nx.append("2")
>        if y in "def":
>            nx.append("3")
>        if y in "ghi":
>            nx.append("4")
>        if y in "jkl":
>            nx.append("5")
>        if y in "mno":
>            nx.append("6")
>        if y in "pqrs":
>            nx.append("7")
>        if y in "tuv":
>            nx.append("8")
>        if y in "wxyz":
>            nx.append("9")
>    number="".join(e for e in nx)
>    return number
>a="1-800-getcharter"
>print (nametonumber(a))#1800 438 2427 837
>a="1-800-leo laporte"
>print (nametonumber(a))
>a="1 800 dialaho"
>print (nametonumber(a))
>
>Please
>

[toc] | [prev] | [next] | [standalone]


#79603 — Re: I am out of trial and error again Lists

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-10-24 19:40 +0100
SubjectRe: I am out of trial and error again Lists
Message-ID<mailman.15145.1414176059.18130.python-list@python.org>
In reply to#79599
On 24/10/2014 19:20, Seymore4Head wrote:
> I meant to type:
> if y in range(1,10) doesn't work.
> Sigh
> Sorry
>

How many more times, state what you expect to happen and what actually 
happens.  "doesn't work" is useless.  Please read this http://sscce.org/

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#79606 — Re: I am out of trial and error again Lists

FromSeymore4Head <Seymore4Head@Hotmail.invalid>
Date2014-10-24 15:07 -0400
SubjectRe: I am out of trial and error again Lists
Message-ID<pp8l4a9h1bdhfjt041jj3udbl16d9kku4t@4ax.com>
In reply to#79603
On Fri, 24 Oct 2014 19:40:39 +0100, Mark Lawrence
<breamoreboy@yahoo.co.uk> wrote:

>On 24/10/2014 19:20, Seymore4Head wrote:
>> I meant to type:
>> if y in range(1,10) doesn't work.
>> Sigh
>> Sorry
>>
>
>How many more times, state what you expect to happen and what actually 
>happens.  "doesn't work" is useless.  Please read this http://sscce.org/

Good suggestion.
OK  how is this?
It doesn't print what I expect.
Does it print what you expect?

name="123-xyz-abc"
for x in name:
    if x in range(10):
        print ("Range",(x))
    if x in str(range(10)):
        print ("String range",(x))

http://i.imgur.com/EGKUpAb.jpg

[toc] | [prev] | [next] | [standalone]


#79622 — Re: I am out of trial and error again Lists

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2014-10-24 21:49 +0000
SubjectRe: I am out of trial and error again Lists
Message-ID<m2ehh7$mv8$6@dont-email.me>
In reply to#79606
On Fri, 24 Oct 2014 15:07:06 -0400, Seymore4Head wrote:

> On Fri, 24 Oct 2014 19:40:39 +0100, Mark Lawrence
> <breamoreboy@yahoo.co.uk> wrote:
> 
>>On 24/10/2014 19:20, Seymore4Head wrote:
>>> I meant to type:
>>> if y in range(1,10) doesn't work.
>>> Sigh Sorry
>>>
>>>
>>How many more times, state what you expect to happen and what actually
>>happens.  "doesn't work" is useless.  Please read this http://sscce.org/
> 
> Good suggestion.
> OK  how is this?
> It doesn't print what I expect.
> Does it print what you expect?
> 
> name="123-xyz-abc"
> for x in name:
>     if x in range(10):
>         print ("Range",(x))
>     if x in str(range(10)):
>         print ("String range",(x))
> 
> http://i.imgur.com/EGKUpAb.jpg

I suspect you're discovering the difference between the python2 and 
python3 range() functions, and what happens when you encapsulate them in 
string.

I've already posted about this once this evening.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#79661 — Re: I am out of trial and error again Lists

FromLarry Hudson <orgnut@yahoo.com>
Date2014-10-24 23:46 -0700
SubjectRe: I am out of trial and error again Lists
Message-ID<3IudnRDHO76s2tbJnZ2dnUU7-VednZ2d@giganews.com>
In reply to#79606
On 10/24/2014 12:07 PM, Seymore4Head wrote:
> On Fri, 24 Oct 2014 19:40:39 +0100, Mark Lawrence
<snip>
>> How many more times, state what you expect to happen and what actually
>> happens.  "doesn't work" is useless.  Please read this http://sscce.org/
>
> Good suggestion.
> OK  how is this?
> It doesn't print what I expect.

That is NO different from the useless crap you consistently give us!  Tell us EXACTLY WHAT YOU 
EXPECT!!

> Does it print what you expect?
Yes it does.  But what I expect is different from what you (erroneously) expect.

> name="123-xyz-abc"
> for x in name:
>      if x in range(10):
x is a character (a one-element string).  range(10) is a list of ints.  A string will never 
match an int.  BTW, as it is used here, range(10) is for Py2, for Py3 it needs to be 
list(range(10)).

>          print ("Range",(x))
>      if x in str(range(10)):
Once again, find out what str(range(10)) actually is.  It is NOT what you think it is.  And I'll 
reiterate what everyone here keeps telling you:  USE THE INTERACTIVE MODE to see what really 
goes on.  If you keep resisting this you are making your understanding several hundred times 
more difficult.

>          print ("String range",(x))

Sorry for the harsh tone.  I'm old, and the curmudgeon is starting to come out in me.

      -=- Larry -=-

[toc] | [prev] | [next] | [standalone]


Page 3 of 8 — ← Prev page 1 2 [3] 4 5 6 7 8  Next page →

Back to top | Article view | comp.lang.python


csiph-web