In this challenge, the task is to debug the existing code to successfully execute all provided test files.
Python supports a useful concept of default argument values. For each keyword argument of a function, we can assign a default value which is going to be used as the value of said argument if the function is called without it.
set the default argument as none and then before 'for' statement set if condition as
ReplyDeleteif stream==none:
stream=EvenStream()
because if it is specified as default argument it will be treated as single EvevStream object for all instances of even therefore giving continuous
0
2
4
6
8
10
for
even 2
even 4
set the default argument as none and then before 'for' statement set if condition as
ReplyDeleteif stream==none:
stream=EvenStream()
because if it is specified as default argument it will be treated as single EvevStream object for all instances of even therefore giving continuous
0
2
4
6
8
10
for
even 2
even 4