Posts by Leonardo Oliveira • 121 points
3 posts
-
0
votes1
answer123
viewsA: How to remove an element from the array by index (Javascript)?
The vector in javascript is an object, and to remove a field from a javascript object, you use delete. So if I have: var obj = { campo1: 'blabla', campo2: 'blabla' } When I do: delete obj['campo1'];…
javascriptanswered Leonardo Oliveira 121 -
6
votes1
answer83
viewsA: Python recursive function
This function you wrote is not recursive! Recursion is when a function calls itself. You have written an iterative function. Look at this code: def Recursiva(n): if n == 1: print(n) return print(n)…
-
3
votes2
answers63
viewsA: Average is not being stored-C
Gustavo, in your code you are iterating 2 times unnecessarily. I took the loop that calculates the average and put inside the for that makes the readings of the notes. #include <stdio.h>…