[Tutor] Sequencing

Alan Gauld alan.gauld at btinternet.com
Thu May 19 19:51:26 CEST 2011


"Cindy Lee" <cindylee2321 at yahoo.com> wrote

> Sorry I am still lost. 

Noah gave you a good breakdown to follow however...

> So I am suppose to use a string? 

You are supposed to use a string as a parameter 
of your function and process it to generate a new 
string which you return from the function.

Do you understand the terms:
parameter
return from the function

> def ReceiveAndReturn():
>        str="I have 5 Apples and 6 oranges";
>       print "str._add1"

This creates a fixed string inside the function, 
it does not receive the string as argument.
And the print statement is very confused. 
Do you understand the difference between
- a string literal
- a string variable
- a string method
- calling a string method

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list