You Are Here:

Community: Developer Discussion Boards

#1 Old return statement - 2008-10-01, 19:31

Join Date: Sep 2008
Posts: 6
titov.enthu
Offline
Registered User
I am trying to return a parameter but it seems imposible through functions in python.

any ideas ?
Reply With Quote

#2 Old Re: return statement - 2008-10-01, 19:33

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Hi Titov,

How do you return a parameter ?

Use the following structure and return statement,
Code:
def fun():
   a=5
   return a

b=fun()
Best Regards,
Croozeus
Reply With Quote

#3 Old Re: return statement - 2008-10-02, 23:36

Join Date: Jun 2008
Posts: 87
GonzalezM
Offline
Regular Contributor
You can also return tuples, arrays or dictionaries if you want multiple outputs:

Code:
def swap(x, y):
    return y, x
	
(x, y) = swap(2, 1)
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
Similar Threads
Thread Thread Starter Forum Replies Last Post
Python for S60 1.4.0 released jplauril Python 43 2009-05-24 10:22
How to port Symbian OS String Descriptors birol.sekerci General Symbian C++ 17 2007-11-08 17:24
求助:电话本人名如何按照拼音排序~~ Kiss_Fish Symbian 5 2006-06-15 10:22
CMdaAudioOutputStream Not working with EXEDLL target fnagaton General Symbian C++ 6 2005-10-03 06:51
关于Float的问题,急死了,各位帮忙一下,谢谢! show_up Other Programming Discussion 关于其他编程技术的讨论 4 2004-08-17 09:57

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