DEV Community

Discussion on: Adding values to an empty list

Collapse
 
dmitrypolo profile image
dmitrypolo

The function you created also does not return anything, it only prints out information. Your append operation should happen when one of the conditions matches.

Collapse
 
itchyonion profile image
Jon Obi

Oh, thanks Dmitry...This was really helpful. To be honest, i didn't quite understand the use of the return(statement), but your input helped me find out more. The code works fine now.