[Tutor] doubt in a program

2018-01-29 Thread vinod bhaskaran
Hi, I am a new beginner in programming. I saw a code (given below) to reverse string. newstring = '' oldstring = 'Newton' for char in oldstring: newstring = char + newstring print(newstring) Could someone explain how it is traversing to get the string reversed? As the new character is add

Re: [Tutor] doubt in a program

2018-01-29 Thread vinod bhaskaran
Thanks a lot Nitin. I misunderstood the "char + newstring". As a newbie to programming as well as newbie to Python trying to grasp basics. Sure will need the built in functions present for different things in Python. Any suggestion good book for python? Thanks, Vinod Bhaskaran On M

[Tutor] can someone explain the reason for error

2018-02-07 Thread vinod bhaskaran
Hi, I am a beginner level programmer and in one assignment the question given is:to remove ',' from a list after getting a comma separated input from console. I gave the below (most print statements are for reference except the last print statement). but i get the attached error. can someone expla

[Tutor] Doubt in list comprehension

2018-02-23 Thread vinod bhaskaran
]] but when i try list comprehension i am not able to get it correctcan someone please suggest where the (a=a+1) should be placed in a list comprehension Thanks, Vinod Bhaskaran ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Doubt in list comprehension

2018-02-23 Thread vinod bhaskaran
Thanks Peter. Shall figure it out with the below hint. I had a hunch am wrong but was not sure where to put in . Thanks, Vinod Bhaskaran On Fri, Feb 23, 2018, 7:11 PM Peter Otten <__pete...@web.de> wrote: > vinod bhaskaran wrote: > > > Hi All, > > > > I am a beg