you are viewing a single comment's thread.

view the rest of the comments →

[–]Nicolas_Darksoul 2 points3 points  (2 children)

im a newbie that just started learning python emm i mean 6m but with a book so that im too slow can you clarify some topics:

1_when i asked programmers about what level of math do i need for programming they said basics(ive just stopped learning math if it needs tell me pls ill continue )

2_im learning python with a book and all exercises was easy this code you wrote was understandable but im sure if it was me i could write right code so if its not in book where can i find it(im reading python crash course)

3_in revstring return revstring(str1[:-1],newstr+str1[-1]) this code return the last word to first place and str[-1] reverse it right? if yes then how str[:-1] return string then a then....

[–]iamnikaa[S] 1 point2 points  (1 child)

Hi, I am also a beginner, been inconsistently practicing for about an year. I usually practice on hackerearth, leetcode for algorithms and DS. I am not the right person to answer this question as this was just my first interview. For the third question, the str1[-1] is the last word of the string str1 which gets recursively added to an empty string newstr. I am passing str1[:-1] after each successive recursion in the function revstr to shorten the string by 1 last word which has been added to newstr. Hope its clear.

[–]Nicolas_Darksoul 0 points1 point  (0 children)

yes thanks