3 Replies - 1054 Views - Last Post: 14 June 2009 - 08:05 AM Rate Topic: -----

#1 xZachtmx  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 125
  • Joined: 14-June 09

How do i get the first number out of a list of two numbers?

Posted 14 June 2009 - 05:30 AM

First of all... this is called a tuple right: 1024,768 ? :P

Ok now for my main question.

How do i get a number list like this
windowSize = 1024,768

and then set a variable that is equal to the first number and then another that is the second number in that list?

Thanks guys :)

Is This A Good Question/Topic? 0
  • +

Replies To: How do i get the first number out of a list of two numbers?

#2 atik97  Icon User is offline

  • ???
  • member icon

Reputation: 144
  • View blog
  • Posts: 715
  • Joined: 16-September 08

Re: How do i get the first number out of a list of two numbers?

Posted 14 June 2009 - 06:39 AM

Both list and tuple are data structures you can use for this purpose-

Use list like this-
windowSize=[1024,768]



and tuple-
windowSize=(1024,768)



Then you can recall it by-
windowSize[0]
windowSize[1]


Was This Post Helpful? 1
  • +
  • -

#3 xZachtmx  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 125
  • Joined: 14-June 09

Re: How do i get the first number out of a list of two numbers?

Posted 14 June 2009 - 06:49 AM

Just what i needed thanks so much!!!
Was This Post Helpful? 0
  • +
  • -

#4 atik97  Icon User is offline

  • ???
  • member icon

Reputation: 144
  • View blog
  • Posts: 715
  • Joined: 16-September 08

Re: How do i get the first number out of a list of two numbers?

Posted 14 June 2009 - 08:05 AM

Nice to know that. Hope to see you around the forum many times...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1