You Are Here:

Community: Developer Discussion Boards

#1 Old HELP - 2008-10-01, 14:57

Join Date: Oct 2008
Posts: 12
kar2905
Offline
Registered User
1.How do we convert a tuple into a list .
I tried using list function but it did not work.

2. Is there any documenatation where we can check the syntax .

3. How do I create a 2D array.

4. l =[u"a",u"b"]
t=[0,1]
for i in t
print l[i]
it gives an error

Why?
Please help .
Reply With Quote

#2 Old Re: HELP - 2008-10-01, 15:04

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Online
Forum Nokia Champion
1. The list function seems to work actually.
Code:
>>> a=(1,2,3)
>>> b=list(a)
>>> b
[1, 2, 3]
How did you use it?

2. Check the syntax of what? Python in general? If so, see this.

3. A 2D array is basically an array of arrays. So something like this:
Code:
1 2 3 4
5 6 7 8
is written in Python like this:
Code:
array=[[1,2,3,4],[5,6,7,8]]
4. Syntax error I guess (you forgot the ":")
Code:
l=[u"a",u"b"]
t=[0,1]
for i in t:
   print l[i]
Reply With Quote

#3 Old Re: HELP - 2008-10-01, 15:32

Join Date: Oct 2008
Posts: 12
kar2905
Offline
Registered User
Quote:
Originally Posted by bogdan.galiceanu View Post
1. The list function seems to work actually.
Code:
>>> a=(1,2,3)
>>> b=list(a)
>>> b
[1, 2, 3]
How did you use it?

2. Check the syntax of what? Python in general? If so, see this.

3. A 2D array is basically an array of arrays. So something like this:
Code:
1 2 3 4
5 6 7 8
is written in Python like this:
Code:
array=[[1,2,3,4],[5,6,7,8]]
4. Syntax error I guess (you forgot the ":")
Code:
l=[u"a",u"b"]
t=[0,1]
for i in t:
   print l[i]

Thank you very much for your prompt reply

1. I tried it in S60 emulator , it did not work there . Do we have to import a special module for it .

2. I checked the website . How can we get a syntax of a function and its uses in python

3. How do we implement 2D array of strings .

4. You were correct . I forgot the colon .
Reply With Quote

#4 Old Re: HELP - 2008-10-01, 15:33

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
hi kar2905

welcome to the forum nokia python dibo.

you can look at he syntax part in the mobapps.org it contains a limited information about syntax now but i am soon planning to add a lot.

So keep a watch

Enjoy Pythoning
Gaba88


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#5 Old Re: HELP - 2008-10-01, 15:38

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
Quote:
Originally Posted by kar2905 View Post
Thank you very much for your prompt reply

1. I tried it in S60 emulator , it did not work there . Do we have to import a special module for it .

2. I checked the website . How can we get a syntax of a function and its uses in python

3. How do we implement 2D array of strings .

4. You were correct . I forgot the colon .
Hi i have replied you in my previous post and the link contains all you need i feel.

Enjoy Pythoning
Gaba88


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#6 Old Re: HELP - 2008-10-01, 15:42

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Online
Forum Nokia Champion
Quote:
Originally Posted by kar2905 View Post
Thank you very much for your prompt reply

1. I tried it in S60 emulator , it did not work there . Do we have to import a special module for it .

2. I checked the website . How can we get a syntax of a function and its uses in python

3. How do we implement 2D array of strings .

4. You were correct . I forgot the colon .
1. Strange... I tried it there too and it worked.

2. This article explains function syntax.

3. Simply replace the numbers with strings.
Reply With Quote

#7 Old Re: HELP - 2008-10-01, 16:03

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
hi kar2905

chintan has just framed a new article at the wiki have a look at this it will really help you.

Enjoy Pythoning
Gaba88


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia