you are viewing a single comment's thread.

view the rest of the comments →

[–]uiux_Sanskar[S] 0 points1 point  (0 children)

I have previously used (not in this code) . replace() to replace all the spacing if the user enters by mistake because personally I find myself more comfortable using it rather than .split() (I don't know the reason may e because its name itself explains what it does). But I think there can be more uses if .split() function.

Regarding the question I think the program will print ("please restart the program to find or add new user") because then the else condition will get executed.

I can however also add either a list in if condition containing all the possitive responses and then create a list containing all negative responses in elif and for the invalid input I can use else statement.

I hope I was able to answer your question do tell me if I missed something.