[Tutor] How do I go about this? [was Re: Who uses input()? [was Re: question on "input"]]

Nathan Pinno falcon3166 at hotmail.com
Thu Jul 28 02:16:49 CEST 2005


Here's part of what I'm looking for (got it from a Python program):
a b
a 2
a 5
a 6
1 b
1 2
1 5
1 6
3 b
3 2
3 5
3 6
4 b
4 2
4 5
4 6
I want to see also !=, ==, and, & nor combos also. 0 != 2 for an example.

----- Original Message ----- 
From: "Danny Yoo" <dyoo at hkn.eecs.berkeley.edu>
To: "Nathan Pinno" <falcon3166 at hotmail.com>
Cc: "Tutor" <tutor at python.org>
Sent: Wednesday, July 27, 2005 5:39 PM
Subject: Re: [Tutor] How do I go about this? [was Re: Who uses input()? [was 
Re: question on "input"]]


>
>
>> I first posted my question in this post, but no one seemed to answer me.
>> >
>> >  It sure did, though I wish there was an easier way of coding it than
>> > int(raw_input())! Any ideas would gladly be appreciated.
>
> Hi Nathan,
>
> About the question about int(raw_input()) being a bit verbose, Brian did
> mention that we can define helper functions to make things less painful.
> Personal function definitions like this can be very useful: we don't
> always have to work at a primitive level, but can build on larger
> concepts.
>
> His suggested get_int() function:
>
>    http://mail.python.org/pipermail/tutor/2005-July/039855.html
>
> looks a bit big at first, but we can define it once, store it in a
> personal library somewhere, and then it'll be available for us from then
> on.
>
>
>> > By the way, is there any code floating out there that can show how
>> > many possible mixtures there are, e.g. for x0, x1, x2, x3, and a0, a1,
>> > a2, and a3 for example.
>
> I think people were a little confused what you meant here; can you give us
> more ideas of what this is for?  "Mixture" in English means so many things
> that it's hard to give concrete answers without seeing more what you mean.
>
>
> Good luck!
>
> 


More information about the Tutor mailing list