Dear All
Shouldn't be the ouput of the program is below ''1''?? Where do I read wrong?
0- do nothing
1- do nothing
2-add dog
3-remove dog
4-add dog
5-do nothing
6-add dog, remove dog
7-do nothing
8- add dog
9-remove dog
Shouldn't be the ouput of the program is below ''1''?? Where do I read wrong?
x = 0 my_list = [] while x < 10: if x % 2 == 0: my_list.append("dog") elif x % 3 == 0: my_list.remove("dog") x = x + 1 print(my_list.count("dog"))My comment:
0- do nothing
1- do nothing
2-add dog
3-remove dog
4-add dog
5-do nothing
6-add dog, remove dog
7-do nothing
8- add dog
9-remove dog