[Tutor] what is wrong with the syntax?

Steve Willoughby steve at alchemy.com
Sat Jul 10 19:18:32 CEST 2010


On 10-Jul-10 10:05, Dipo Elegbede wrote:
> Hi all,
> please tell me what is wrong with the syntax as written herein:
> http://pastebin.com/BkLi0A4H
> I am actually trying to let a user input something and have the input
> returned in a reverse form and also see the lenght of the input.
> please help.

Is this for Python 3.x or 2.x?  It makes a big difference in what 
input() means.  I'm guessing 2.x from the rest of the script, so what 
you probably want is raw_input, not input.... unless you really want 
them to type Python source there which is interpreted as a list of 
values or whatever.

I'm not sure what you want to accomplish with str() and list(), though. 
  Those create a string, and then a list, but you never assign the new 
string or list to anything.  Neither actually changes the "wording" 
variable.

Remember that the comma separating items in the print statement is a 
syntactic feature of the language.  You have them inside the strings 
you're printing.

>
> --
> Elegbede Muhammed Oladipupo
> OCA
> +2348077682428
> +2347042171716
> www.dudupay.com <http://www.dudupay.com>
> Mobile Banking Solutions | Transaction Processing | Enterprise
> Application Development
>
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list