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

Page 1 of 1

## 3 Replies - 1068 Views - Last Post: 14 June 2009 - 08:05 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=109920&amp;s=f29dd78aab865365a0c16878348b4d8b&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 xZachtmx

Reputation: 4
• 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 ?

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

• ???

Reputation: 144
• 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]

```

### #3 xZachtmx

Reputation: 4
• 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!!!

### #4 atik97

• ???

Reputation: 144
• 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...