Nestes exercícios iremos exercitar os métodos auxiliares para array:
- forEach
- map
- filter
Altere o código a seguir para utilizar a função forEach de modo que a saída permaneça a mesma.
| usuarios = [] | |
| def cadastrar_usuario(): | |
| nome = input("Digite o nome do usuário: ") | |
| email = input("Digite o e-mail do usuário: ") | |
| usuarios.append({"nome": nome, "email": email}) | |
| print("Usuário cadastrado com sucesso!\n") | |
| def listar_usuarios(): | |
| if not usuarios: |
| import { useEffect, useState } from "react"; | |
| // id, size, x, y, opacity, animationDuration | |
| // id, size, x, y, delay, animationDuration | |
| export const StarBackground = () => { | |
| const [stars, setStars] = useState([]); | |
| const [meteors, setMeteors] = useState([]); | |
| useEffect(() => { |
| print("*******************************") | |
| print(" GERENCIADOR DE TAREFAS ") | |
| print("*******************************") | |
| print("Qual ação você gostaria de executar?") | |
| print("Opção 0 : Sair") | |
| print("Opção 1 : Adicionar nova tarefa") | |
| print("Opção 2 : Ver todas as tarefas pendentes") | |
| print("Opção 3 : Concluir uma tarefa pendente") | |
| print("Opção 4 : Ver todas as tarefas concluidas") |
| import { useEffect, useState } from 'react' | |
| import './App.css' | |
| import axios from 'axios'; | |
| type Character = { | |
| image: string; | |
| name: string; | |
| } | |
| type APIResponse = { |
| 'use strict'; | |
| /** @type {import('sequelize-cli').Migration} */ | |
| module.exports = { | |
| async up(queryInterface, Sequelize) { | |
| await queryInterface.bulkInsert( | |
| "localidade", | |
| [ | |
| { | |
| nome_localidade: "Localidade 10", |
| 'use strict'; | |
| /** @type {import('sequelize-cli').Migration} */ | |
| module.exports = { | |
| async up(queryInterface, Sequelize) { | |
| await queryInterface.bulkInsert( | |
| "locais", | |
| [ | |
| { | |
| usuario_id: 9, |
| 'use strict'; | |
| /** @type {import('sequelize-cli').Migration} */ | |
| module.exports = { | |
| async up(queryInterface, Sequelize) { | |
| await queryInterface.bulkInsert( | |
| "usuario", | |
| [ | |
| { | |
| nome_completo: 'Java', |
| [user] | |
| name = seunomeaqui | |
| email = seuemailaqui@gmail.com | |
| [core] | |
| editor = notepad | |
| [merge] | |
| tool = meld | |
| keepBackup = false | |
| [mergetool] | |
| keepBackup = false |
| window.onload = function() { | |
| console.log("carregando arquivo..."); | |
| var canvas = document.getElementById("canvas"); | |
| var boneco = document.getElementById("boneco"); | |
| var ctx = canvas ? canvas.getContext("2d") : null; | |
| var bonecoCoord = { | |
| x: 25, | |
| y: 200 | |
| } |