I am stuck.. Please help me with implementing two dimensional array
in Python.
Hi Asrarahmed,
What do you need a two-dimensional array for? This is a serious question:
what's your application? What are you trying to represent, and why?
As a glib possible answer: you can use a di
>> I feel
>> 7/3 should give -2
>>
>> since integer divison returns floor
>
> The floor is the next lowest integer to the float.
> floor(-3.1) will be -4
> floor(3.) will be 3
Hi Joseph,
If it helps, draw out the floor function out on a piece of graph paper.
^
> def number(number):
> ran=input("range >")
> ran=ran+1
> from random import randrange
> guessed=[]
> guess=randrange(ran)
> print guess
> guessed.append(guess)
> guesses=1
> guessed=[] < Why do you reset guessed to an empty list
> here?
also couldn'
Asrarahmed,
How about something like this:
>>> arr = []
>>> arr.append(['Blue', 'Yellow', 'Green', 'Brown', 'White'])
>>> arr[0][0]
'Blue'
>>> arr.append(['Up', 'Down', 'Left', 'Right', 'Center'])
>>> arr[1][4]
'Center'
Is this what you were thinking of?
-mtw
On Wed, Oct 04, 2006 at 06:38:09P
shawn bright wrote:
> Hey there,
>
> this time my question is a bit simpler.
> i can make a byte a string or number or whatever now. Up to the number 255.
> I now have a problem with something that comes in as a 4 byte
> representation of
> the number of seconds since 1970.
> I have been using or
shawn bright wrote:
> Hey there,
>
> this time my question is a bit simpler.
> i can make a byte a string or number or whatever now. Up to the number
> 255.
> I now have a problem with something that comes in as a 4 byte
> representation of
> the number of seconds since 1970.
> I have been using
Asrarahmed Kadri wrote:
>
> I am looking for something like this:
>
> int arr[5][5]; // C statement; declaring an array of 5 * 5 size
>
> Is there an easy and clean way to achieve this in python???
Can you say something about your use case? If I had to guess I would say
numpy is what you ar
Hey there,this time my question is a bit simpler.i can make a byte a string or number or whatever now. Up to the number 255.I now have a problem with something that comes in as a 4 byte representation of
the number of seconds since 1970. I have been using ord(byte) to make sense of the messages so
I am looking for something like this:
int arr[5][5]; // C statement; declaring an array of 5 * 5 size
Is there an easy and clean way to achieve this in python???
Thanks
On 10/4/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
Asrarahmed Kadri wrote:>> Hi folks,>> I am stuck.. Please help me wi
On Tue, Oct 03, 2006 at 05:05:59PM +1300, Liam Clarke wrote:
>
>
> Original Message
> Subject: Re: [Tutor] database web app, what tool?
> Date: Mon, 02 Oct 2006 09:33:28 +0100
> From: [EMAIL PROTECTED]
> To: Liam Clarke <[EMAIL PROTECTED]>
> References:
Asrarahmed Kadri wrote:
>
> Hi folks,
>
> I am stuck.. Please help me with implementing two dimensional array in
> Python.
Nested lists are the simplest way though beware the gotcha shown here:
http://www.python.org/doc/faq/programming/#how-do-i-create-a-multidimensional-list
You can also use
Asrarahmed Kadri wrote:
>
> Hi folks,
>
> I am stuck.. Please help me with implementing two dimensional array in
> Python.
>
There are no such things as arrays in Python, silly!
I can help you with a two-dimensional list, though :)
Okay, imagine that a list of integers (or any other objects)
Hi folks,
I am stuck.. Please help me with implementing two dimensional array in Python.
Thanks.
-- To HIM you shall return.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
2006/10/4, Kent Johnson <[EMAIL PROTECTED]>:
> hey i added another guessing feature that shuld guess the number in the
> most
> effective way
> but i keep getting into endless loops thought you might want it
> any help with the loops would be great
What's the value of number? Where is it defined
Forwarding to the list
Original Message
Subject: guess
Date: Tue, 03 Oct 2006 18:12:08 -0600
From: mike viceano <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
hey i added another guessing feature that shuld guess the number in the
most
effective way
but i keep getting into endless
Matthew Warren wrote:
> I think eve-online is written in stackless python, they make quite a
> dealy about it on their site www.eve-online.com although I cant find the
> page myself right now due to filters in the way.
Yes, I think you're right that they use stackless. CCP Games was a
sponsor of
I think eve-online is written in stackless python, they make quite a
dealy about it on their site www.eve-online.com although I cant find the
page myself right now due to filters in the way.
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Kent John
> =
> import random
>
> coin1 = 0
> coin2 = 0
>
> coin1 = random.randint(1, 10)
> coin2 = random.randint(1, 10)
>
> if coin1 <= 5:
> print "Coin1 is Heads"
> else:
> print "Coin1 is Tails"
>
> if coin2 <= 5:
> print "Coin2 is Heads"
> else:
> print "C
Carlos wrote:
> Thanks Luke and Kent,
>
> To get CGKit running I need to do two different things:
>
> First the Python Computer Graphics Kit is composed by an
> "cgkit-2.0.0alpha6.win32-py2.4.exe" file and some dependencies that are
> PyProtocols, numarray, PyOpenGL, PIL, pygame, PyODE and pySe
Thanks Luke! This is helpful :)- ArunOn 10/4/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote:
Arun Kumar PG wrote:> Thanks Luke.>> I want to make a 3-D car race game between two players. And yes its
> gonna be a networked game where each user will be using his/her own> PC and playing.If you want i
Arun Kumar PG wrote:
> Thanks Luke.
>
> I want to make a 3-D car race game between two players. And yes its
> gonna be a networked game where each user will be using his/her own
> PC and playing.
If you want it to be 3d, you have a couple'o choices...
Pygame with the PyopenGL interface,
Panda3d,
Also, my idea is to have a centralised Python server which acts as a dispachter to send the coordinate and other information to the gaming clients.On 10/4/06,
Arun Kumar PG <[EMAIL PROTECTED]> wrote:
Thanks Luke.I want to make a 3-D car race game between two players. And yes its gonna be a networ
Thanks Luke.I want to make a 3-D car race game between two players. And yes its gonna be a networked game where each user will be using his/her own PC and playing.- Arun
On 10/4/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote:
Arun Kumar PG wrote:> Hi All Python lovers!>>> I want to develop a Car
Arun Kumar PG wrote:
> Hi All Python lovers!
>
>
> I want to develop a Car racing game using Python. I was looking for
> the libraries which I should use for the same. Some of the options are
> below and I want you suggestions about the best set of tools and APIs
> as per your experiences:
>
> -
Hi All Python lovers!I want to develop a Car racing game using Python. I was looking for the libraries which I should use for the same. Some of the options are below and I want you suggestions about the best set of tools and APIs as per your experiences:
- PyGame- Panda3D- Pixie for rendering- Rend
25 matches
Mail list logo