if previous number in the list is the same as current number in the list, delete current one python code example
Example 1: add up all the numbers in each row and output that number output the grand total of all rows
Add up all the numbers in each row and output that number
Output the grand total of all rows
total = 0
for x in variable:
x_total = 0
for y in x:
x_total = int(y) + x_total
print(x_total)
total = x_total + total
print(total)
Example 2: create a function that takes in an array of numbers and returns only the number that are even after 1 is added to the value
const evenAfter = (arr) => {
let i = 0
let newArr = []
while (i <= arr.length) {
if ((arr[i] + 1) % 2 === 0){
newArr.push(arr[i])
}
i++
}
return newArr
}
console.log(evenAfter([3,6,7,8,9,11]))