www.tutorialspoint.com Forum Index
Register FAQMemberlistUsergroupsTutorials PointLog in
Reply to topic Page 1 of 1
Is that an error in Python tutorial?
Author Message
Reply with quote
Post Is that an error in Python tutorial? 
Hi, I like it your Python tutorial! Thanks, it is really good. But I think you did mistake on this page http://www.tutorialspoint.com/python/python_loop_control.htm. Check example of The continue Statement, I guess this part of code should be like this:
Code:
var = 10                    # Second Example
while var > 0:
   var = var - 1
   if var == 5:
      continue
   print 'Current variable value :', var;

And of course it will affect the result of it, where number 5 will not be printed.

Am I correct? ))

View user's profile Send private message
Reply with quote
Post  
Thanks Paniov, I have fixed it.

View user's profile Send private message Send e-mail
Reply with quote
Post Missing argument in example 
on page http://www.tutorialspoint.com/python/string_maketrans.htm
the str.translate example only has one argument: trantab.
It should have two: the line it is working on, and trantab e.g. str.translate(line,trantab)

View user's profile Send private message
Reply with quote
Post  
Pls try given example and I'm sure it will work.

!/usr/bin/python

from string import maketrans # Required to call maketrans function.

intab = "aeiou"
outtab = "12345"
trantab = maketrans(intab, outtab)

str = "this is string example....wow!!!";
print str.translate(trantab);

View user's profile Send private message Send e-mail
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum