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


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

Python questions help

Started bysu29090 <129km09@gmail.com>
First post2012-11-14 17:47 -0800
Last post2012-11-20 08:35 +1100
Articles 6 — 4 participants

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


Contents

  Python questions help su29090 <129km09@gmail.com> - 2012-11-14 17:47 -0800
    Re: Python questions help Chris Angelico <rosuav@gmail.com> - 2012-11-15 13:01 +1100
    Re: Python questions help rh <richard_hubbe11@lavabit.com> - 2012-11-16 10:00 -0800
    Re: Python questions help Chris Angelico <rosuav@gmail.com> - 2012-11-17 05:08 +1100
      Re: Python questions help Neil Cerutti <neilc@norwich.edu> - 2012-11-19 14:57 +0000
        Re: Python questions help Chris Angelico <rosuav@gmail.com> - 2012-11-20 08:35 +1100

#33363 — Python questions help

Fromsu29090 <129km09@gmail.com>
Date2012-11-14 17:47 -0800
SubjectPython questions help
Message-ID<b581f506-bd54-47a3-af39-fc3e561cd188@googlegroups.com>
I brought a python book and i'm a beginner and I read and tried to do the questions and I still get it wrong.

How to create a program that reads an uspecified number of integers, that determines how many positive and negative values have been read, and computes the total and average of the input values(not counting zeroes). My program have to end with the input 0 and have to display the average as a floating-point number.


Use nested loops that display the following patterns in separate programs:

1
12
123
1234
12345
123456

123456
12345
1234
123
12
1

     1
    21
   321
  4321
 54321
654321

Write a program that computes the following summation:

1/ 1+square root of 2 + 1/ 1+square root of 2 + square root of 3 + 1/ 1+square root of 3 + square root of 4...+ 1/ 1+square root of 624 + square root of 625

How to  a program to draw a chessboard using range?

Thanks

[toc] | [next] | [standalone]


#33365

FromChris Angelico <rosuav@gmail.com>
Date2012-11-15 13:01 +1100
Message-ID<mailman.3706.1352944880.27098.python-list@python.org>
In reply to#33363
On Thu, Nov 15, 2012 at 12:47 PM, su29090 <129km09@gmail.com> wrote:
> I brought a python book and i'm a beginner and I read and tried to do the questions and I still get it wrong.

Pick one of the questions, write as much of the code as you can, and
then post the specific difficulties you're having. If we write the
code for you, it won't help you to learn, will it?

Once you have some code that isn't working, we can help you to figure
out what it is that isn't working. But do your best to write the code
yourself first.

Chris Angelico

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


#33446

Fromrh <richard_hubbe11@lavabit.com>
Date2012-11-16 10:00 -0800
Message-ID<mailman.3754.1353089097.27098.python-list@python.org>
In reply to#33363
On Wed, 14 Nov 2012 17:47:33 -0800 (PST)
su29090 <129km09@gmail.com> wrote:

> I brought a python book and i'm a beginner and I read and tried to do
> the questions and I still get it wrong.

I am just starting to dabble in python. And just to let you know I was
watching a pycon (or somecon) and the speaker asked the audience
"How many of you are programmers?" 
Result: Lots of hands raised.

"How many people think programming skills are inherent?"
i.e. that some people are just born with the gift to be good programmers
Result: very few hands raised maybe a couple (possibly non-progammers??)

Anyway there's reason to keep at it and slog your way through to proficiency.
Because you will become proficient.  It's like reading a book by Neal Stephenson,
you read along and say wtf, but you keep reading and things start making some
sense....or learning to play a musical instrument or the like.

Anyway I've taken a stab at these but I won't be the spoiler. Although I admit
that a couple of lessons are unclear to me. For example "Do I get extra points
if I don't use nested loops where I don't need them?". Or do I get marked down?

I've completed the rows/columns of 123456 and the chessboard but the others
are not clear. I did the squareroot problem but that's unclear.

> 
> How to create a program that reads an uspecified number of integers,
> that determines how many positive and negative values have been read,
> and computes the total and average of the input values(not counting
> zeroes). My program have to end with the input 0 and have to display
> the average as a floating-point number.
> 
> 
> Use nested loops that display the following patterns in separate
> programs:
> 
> 1
> 12
> 123
> 1234
> 12345
> 123456
> 
> 123456
> 12345
> 1234
> 123
> 12
> 1
> 
>      1
>     21
>    321
>   4321
>  54321
> 654321
> 
> Write a program that computes the following summation:
> 
> 1/ 1+square root of 2 + 1/ 1+square root of 2 + square root of 3 + 1/
> 1+square root of 3 + square root of 4...+ 1/ 1+square root of 624 +
> square root of 625
> 
> How to  a program to draw a chessboard using range?
> 
> Thanks


-- 

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


#33447

FromChris Angelico <rosuav@gmail.com>
Date2012-11-17 05:08 +1100
Message-ID<mailman.3755.1353089313.27098.python-list@python.org>
In reply to#33363
On Sat, Nov 17, 2012 at 5:00 AM, rh <richard_hubbe11@lavabit.com> wrote:
> "How many people think programming skills are inherent?"
> i.e. that some people are just born with the gift to be good programmers
> Result: very few hands raised maybe a couple (possibly non-progammers??)

Maybe, but there's definitely something that happens close to birth.
If your parents give you the name Chris, you're more likely to become
a geek and a programmer.

ChrisA

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


#33540

FromNeil Cerutti <neilc@norwich.edu>
Date2012-11-19 14:57 +0000
Message-ID<aguvndFl9r3U2@mid.individual.net>
In reply to#33447
On 2012-11-16, Chris Angelico <rosuav@gmail.com> wrote:
> On Sat, Nov 17, 2012 at 5:00 AM, rh
> <richard_hubbe11@lavabit.com> wrote:
>> "How many people think programming skills are inherent?" i.e.
>> that some people are just born with the gift to be good
>> programmers Result: very few hands raised maybe a couple
>> (possibly non-progammers??)
>
> Maybe, but there's definitely something that happens close to
> birth. If your parents give you the name Chris, you're more
> likely to become a geek and a programmer.

There are people with rare talent who can program in a way that
most others can't, .e.g, Chris Sawyer. But, as Louis Moyse, a
great musician remarked: "Without hard work, talent means
nothing."

-- 
Neil Cerutti

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


#33558

FromChris Angelico <rosuav@gmail.com>
Date2012-11-20 08:35 +1100
Message-ID<mailman.13.1353360904.29569.python-list@python.org>
In reply to#33540
On Tue, Nov 20, 2012 at 1:57 AM, Neil Cerutti <neilc@norwich.edu> wrote:
> On 2012-11-16, Chris Angelico <rosuav@gmail.com> wrote:
>> On Sat, Nov 17, 2012 at 5:00 AM, rh
>> <richard_hubbe11@lavabit.com> wrote:
>>> "How many people think programming skills are inherent?" i.e.
>>> that some people are just born with the gift to be good
>>> programmers Result: very few hands raised maybe a couple
>>> (possibly non-progammers??)
>>
>> Maybe, but there's definitely something that happens close to
>> birth. If your parents give you the name Chris, you're more
>> likely to become a geek and a programmer.
>
> There are people with rare talent who can program in a way that
> most others can't, .e.g, Chris Sawyer. But, as Louis Moyse, a
> great musician remarked: "Without hard work, talent means
> nothing."

Sure, it definitely takes work. You still have to put in your ten
thousand hours. I don't know what the connection is, but there do seem
to be a LOT of geeky Chrises; in fact, in any mid-length thread here
on python-list, you could probably conclude with a "Thanks for the
tip, Chris, it works now!" without even bothering to read it.

ChrisA

[toc] | [prev] | [standalone]


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


csiph-web