0

what is the condition in while in line 19(ANSWERED)

https://code.sololearn.com/cloC3anvro20/#py here a program which i found online in this can some one tell me what while loops condition and why it was used THe program is replacing current last node of the linked list to the new data node. So the current last node of the linked list becomes the second last data node and the new node becomes the last node of the linked list.

14th Oct 2020, 5:57 AM
Bijin Sanny
Bijin Sanny - avatar
5 Answers
+ 3
Bijin Sanny, the parentheses make no difference in python, you could just as well erase them. It's as Ipang said: laste is replaced by the next value, until the next value is None, then the loop stops.
16th Oct 2020, 12:46 PM
HonFu
HonFu - avatar
+ 3
HonFu Need a bit of help here ... 馃檹
16th Oct 2020, 11:06 AM
Ipang
+ 2
Looks like it defines the loop to continue running while the appointed Node object has a next value link. Not too good with Python and DS, so I could be wrong.
16th Oct 2020, 7:31 AM
Ipang
+ 2
Thanks HonFu for u r answes I understood it now鉁岋笍
16th Oct 2020, 12:49 PM
Bijin Sanny
Bijin Sanny - avatar
+ 1
Ipang Thanks man but what I was trying to ask was the condition inside the parenthesis... I too just started to learn about classes and it's uses so it's rough sometimes
16th Oct 2020, 11:02 AM
Bijin Sanny
Bijin Sanny - avatar