Skip to content

Tag: nested-lists

Remove duplicate value on nested list python

I have a problem here when I want to remove duplicate in a list that has a nested list, how can I remove the duplicate value from list? What I got here from my script, it can remove a duplicate, but the nested list has a different result from what I expect. This is my script: Result: Expected Result: Answer

Checking If Position Exists in Nested List

I’m trying to solve a Python coding problem. Given a certain array containing only 1’s and 0’s I must write a program that returns an array following a few rules: Each 1 must be replaced with a 9 Each 0 must be replaced with the amount of 1’s in its immediate surroundings (above, below…